cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r695041 - /cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
Date Sat, 13 Sep 2008 22:08:00 GMT
Author: bimargulies
Date: Sat Sep 13 15:08:00 2008
New Revision: 695041

URL: http://svn.apache.org/viewvc?rev=695041&view=rev
Log:
remove some dead-ish code left over from when XFire supported Java 1.4, 
or a smaller classpath. Either way, make 
javax.xml.XMLGregorianCalendarType required in the classpath.



Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java?rev=695041&r1=695040&r2=695041&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
Sat Sep 13 15:08:00 2008
@@ -39,7 +39,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.cxf.aegis.DatabindingException;
 import org.apache.cxf.aegis.type.basic.Base64Type;
 import org.apache.cxf.aegis.type.basic.BigDecimalType;
 import org.apache.cxf.aegis.type.basic.BigIntegerType;
@@ -68,7 +67,6 @@
 import org.apache.cxf.aegis.type.xml.SourceType;
 import org.apache.cxf.aegis.type.xml.XMLStreamReaderType;
 import org.apache.cxf.binding.soap.Soap11;
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.SOAPConstants;
 import org.apache.cxf.common.util.XMLSchemaQNames;
 import org.jdom.Element;
@@ -322,55 +320,35 @@
                         CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME,
                         new CharacterAsStringType());
 
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.Duration", XMLSchemaQNames.XSD_DURATION,
-                            "org.apache.cxf.aegis.type.java5.DurationType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.Duration.class, XMLSchemaQNames.XSD_DURATION,
+                            new org.apache.cxf.aegis.type.java5.DurationType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_DATE,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_TIME,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_G_DAY,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_G_MONTH,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_G_MONTH_DAY,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_G_YEAR,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_G_YEAR_MONTH,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        registerIfAvailable(tm, defaultNillable, "javax.xml.datatype.XMLGregorianCalendar",
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
+        defaultRegister(tm, defaultNillable, javax.xml.datatype.XMLGregorianCalendar.class,
                             XMLSchemaQNames.XSD_DATETIME,
-                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+                            new org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType());
         return tm;
     }
 
-    private static void registerIfAvailable(TypeMapping tm, boolean defaultNillable, String
className,
-                                            QName typeName, String typeClassName) {
-        try {
-            Class cls = ClassLoaderUtils.loadClass(className, DefaultTypeMapping.class);
-            Class typeCls = ClassLoaderUtils.loadClass(typeClassName, DefaultTypeMapping.class);
-            try {
-                Type type = (Type)typeCls.newInstance();
-
-                defaultRegister(tm, defaultNillable, cls, typeName, type);
-            } catch (InstantiationException e) {
-                throw new DatabindingException("Couldn't instantiate Type ", e);
-            } catch (IllegalAccessException e) {
-                throw new DatabindingException("Couldn't instantiate Type ", e);
-            }
-        } catch (ClassNotFoundException e) {
-            LOG.debug("Could not find optional Type " + className + ". Skipping.");
-        }
-
-    }
-
     public String getMappingIdentifierURI() {
         return identifierURI;
     }



Mime
View raw message