cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r631437 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/common/util/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/
Date Wed, 27 Feb 2008 00:31:15 GMT
Author: bimargulies
Date: Tue Feb 26 16:31:10 2008
New Revision: 631437

URL: http://svn.apache.org/viewvc?rev=631437&view=rev
Log:
First bit of Aegis cleanup. Move a heap of constants that are not 
Aegis-specific to better homes.

Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
  (with props)
Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java

Added: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java?rev=631437&view=auto
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
(added)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
Tue Feb 26 16:31:10 2008
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.common.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This class provides QNames for all of the XML Schema types. 
+ */
+public final class XMLSchemaQNames {
+    public static final QName XSD_STRING = new QName(SOAPConstants.XSD, "string", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_LONG = new QName(SOAPConstants.XSD, "long", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_FLOAT = new QName(SOAPConstants.XSD, "float", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_DOUBLE = new QName(SOAPConstants.XSD, "double", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_INT = new QName(SOAPConstants.XSD, "int", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_SHORT = new QName(SOAPConstants.XSD, "short", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_BOOLEAN = new QName(SOAPConstants.XSD,
+                                                         "boolean", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_DATETIME = new QName(SOAPConstants.XSD, "dateTime",
+                                                          SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_TIME = new QName(SOAPConstants.XSD, "dateTime", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_BASE64 = new QName(SOAPConstants.XSD, "base64Binary",
+                                                        SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_DECIMAL = new QName(SOAPConstants.XSD,
+                                                         "decimal", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_INTEGER = new QName(SOAPConstants.XSD,
+                                                         "integer", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_URI = new QName(SOAPConstants.XSD, "anyURI", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_ANY = new QName(SOAPConstants.XSD, "anyType", SOAPConstants.XSD_PREFIX);
+
+    public static final QName XSD_DATE = new QName(SOAPConstants.XSD, "date", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_DURATION = new QName(SOAPConstants.XSD, "duration",
+                                                          SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_G_YEAR_MONTH = new QName(SOAPConstants.XSD, "gYearMonth",
+                                                              SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_G_MONTH_DAY = new QName(SOAPConstants.XSD, "gMonthDay",
+                                                             SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_G_YEAR = new QName(SOAPConstants.XSD, "gYear", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_G_MONTH = new QName(SOAPConstants.XSD, "gMonth", SOAPConstants.XSD_PREFIX);
+    public static final QName XSD_G_DAY = new QName(SOAPConstants.XSD, "gDay", SOAPConstants.XSD_PREFIX);
+    
+    private XMLSchemaQNames() {
+    }
+}

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/XMLSchemaQNames.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java?rev=631437&r1=631436&r2=631437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
Tue Feb 26 16:31:10 2008
@@ -22,11 +22,26 @@
 import javax.xml.namespace.QName;
 
 /**
- * Represents the SOAP 1.1 version
+ * Singleton object that represents the SOAP 1.1 version.
  * 
  */
 public final class Soap11 implements SoapVersion {
+    
+    // some constants that don't fit into the SoapVersion paradigm.
     public static final String SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
+    public static final String SOAP_ENCODING_URI = "http://schemas.xmlsoap.org/soap/encoding/";
+    public static final QName ENCODED_STRING = new QName(SOAP_ENCODING_URI, "string");
+    public static final QName ENCODED_LONG = new QName(SOAP_ENCODING_URI, "long");
+    public static final QName ENCODED_FLOAT = new QName(SOAP_ENCODING_URI, "float");
+    public static final QName ENCODED_CHAR = new QName(SOAP_ENCODING_URI, "char");
+    public static final QName ENCODED_DOUBLE = new QName(SOAP_ENCODING_URI, "double");
+    public static final QName ENCODED_INT = new QName(SOAP_ENCODING_URI, "int");
+    public static final QName ENCODED_SHORT = new QName(SOAP_ENCODING_URI, "short");
+    public static final QName ENCODED_BOOLEAN = new QName(SOAP_ENCODING_URI, "boolean");
+    public static final QName ENCODED_DATETIME = new QName(SOAP_ENCODING_URI, "dateTime");
+    public static final QName ENCODED_BASE64 = new QName(SOAP_ENCODING_URI, "base64Binary");
+    public static final QName ENCODED_DECIMAL = new QName(SOAP_ENCODING_URI, "decimal");
+    public static final QName ENCODED_INTEGER = new QName(SOAP_ENCODING_URI, "integer");
 
     private static final Soap11 INSTANCE = new Soap11();
 
@@ -42,7 +57,7 @@
     
     private final String nextRole = "http://schemas.xmlsoap.org/soap/actor/next";
 
-    private final String soapEncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
+    private final String soapEncodingStyle = SOAP_ENCODING_URI;
 
     private final QName envelope = new QName(namespace, "Envelope", prefix);
 
@@ -55,6 +70,8 @@
     private Soap11() {
         // Singleton 
     }
+    
+
 
     public static Soap11 getInstance() {
         return INSTANCE;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=631437&r1=631436&r2=631437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
Tue Feb 26 16:31:10 2008
@@ -34,6 +34,7 @@
 import org.apache.cxf.aegis.type.collection.MapType;
 import org.apache.cxf.aegis.util.NamespaceHelper;
 import org.apache.cxf.aegis.util.ServiceUtils;
+import org.apache.cxf.common.util.XMLSchemaQNames;
 import org.apache.cxf.wsdl.WSDLConstants;
 
 /**
@@ -243,7 +244,7 @@
 
     protected Type createObjectType() {
         ObjectType type = new ObjectType();
-        type.setSchemaType(DefaultTypeMappingRegistry.XSD_ANY);
+        type.setSchemaType(XMLSchemaQNames.XSD_ANY);
         type.setTypeClass(Object.class);
         type.setTypeMapping(getTypeMapping());
         return type;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java?rev=631437&r1=631436&r2=631437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
Tue Feb 26 16:31:10 2008
@@ -71,6 +71,7 @@
 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;
 
 /**
@@ -79,56 +80,11 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  * @since Feb 22, 2004
  */
-public final class DefaultTypeMappingRegistry extends AbstractTypeMappingRegistry 
-    implements TypeMappingRegistry {
-    static final QName XSD_STRING = new QName(SOAPConstants.XSD, "string", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_LONG = new QName(SOAPConstants.XSD, "long", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_FLOAT = new QName(SOAPConstants.XSD, "float", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_DOUBLE = new QName(SOAPConstants.XSD, "double", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_INT = new QName(SOAPConstants.XSD, "int", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_SHORT = new QName(SOAPConstants.XSD, "short", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_BOOLEAN = new QName(SOAPConstants.XSD,
-                                                         "boolean", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_DATETIME = new QName(SOAPConstants.XSD, "dateTime",
-                                                          SOAPConstants.XSD_PREFIX);
-    static final QName XSD_TIME = new QName(SOAPConstants.XSD, "dateTime", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_BASE64 = new QName(SOAPConstants.XSD, "base64Binary",
-                                                        SOAPConstants.XSD_PREFIX);
-    static final QName XSD_DECIMAL = new QName(SOAPConstants.XSD,
-                                                         "decimal", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_INTEGER = new QName(SOAPConstants.XSD,
-                                                         "integer", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_URI = new QName(SOAPConstants.XSD, "anyURI", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_ANY = new QName(SOAPConstants.XSD, "anyType", SOAPConstants.XSD_PREFIX);
-
-    static final QName XSD_DATE = new QName(SOAPConstants.XSD, "date", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_DURATION = new QName(SOAPConstants.XSD, "duration",
-                                                          SOAPConstants.XSD_PREFIX);
-    static final QName XSD_G_YEAR_MONTH = new QName(SOAPConstants.XSD, "gYearMonth",
-                                                              SOAPConstants.XSD_PREFIX);
-    static final QName XSD_G_MONTH_DAY = new QName(SOAPConstants.XSD, "gMonthDay",
-                                                             SOAPConstants.XSD_PREFIX);
-    static final QName XSD_G_YEAR = new QName(SOAPConstants.XSD, "gYear", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_G_MONTH = new QName(SOAPConstants.XSD, "gMonth", SOAPConstants.XSD_PREFIX);
-    static final QName XSD_G_DAY = new QName(SOAPConstants.XSD, "gDay", SOAPConstants.XSD_PREFIX);
-
-    static final String ENCODED_NS = Soap11.getInstance().getSoapEncodingStyle();
-    static final QName ENCODED_STRING = new QName(ENCODED_NS, "string");
-    static final QName ENCODED_LONG = new QName(ENCODED_NS, "long");
-    static final QName ENCODED_FLOAT = new QName(ENCODED_NS, "float");
-    static final QName ENCODED_CHAR = new QName(ENCODED_NS, "char");
-    static final QName ENCODED_DOUBLE = new QName(ENCODED_NS, "double");
-    static final QName ENCODED_INT = new QName(ENCODED_NS, "int");
-    static final QName ENCODED_SHORT = new QName(ENCODED_NS, "short");
-    static final QName ENCODED_BOOLEAN = new QName(ENCODED_NS, "boolean");
-    static final QName ENCODED_DATETIME = new QName(ENCODED_NS, "dateTime");
-    static final QName ENCODED_BASE64 = new QName(ENCODED_NS, "base64Binary");
-    static final QName ENCODED_DECIMAL = new QName(ENCODED_NS, "decimal");
-    static final QName ENCODED_INTEGER = new QName(ENCODED_NS, "integer");
+public final class DefaultTypeMappingRegistry extends AbstractTypeMappingRegistry implements
+    TypeMappingRegistry {
 
     private static final Log LOG = LogFactory.getLog(DefaultTypeMappingRegistry.class);
 
-
     private Map<String, TypeMapping> registry;
 
     private TypeMapping defaultTM;
@@ -138,7 +94,7 @@
     public DefaultTypeMappingRegistry() {
         this(null, false, false);
     }
-    
+
     public DefaultTypeMappingRegistry(TypeCreator typeCreator, boolean createDefault) {
         this(typeCreator, createDefault, false);
     }
@@ -147,7 +103,8 @@
         this(null, createDefault, false);
     }
 
-    public DefaultTypeMappingRegistry(TypeCreator typeCreator, boolean createDefault, 
+    public DefaultTypeMappingRegistry(TypeCreator typeCreator, 
+                                      boolean createDefault, 
                                       boolean enableMtomXmime) {
         registry = Collections.synchronizedMap(new HashMap<String, TypeMapping>());
 
@@ -235,18 +192,13 @@
 
     protected TypeCreator createTypeCreator() {
         AbstractTypeCreator xmlCreator = createRootTypeCreator();
-    
+
         Java5TypeCreator j5Creator = new Java5TypeCreator();
         j5Creator.setNextCreator(createDefaultTypeCreator());
         j5Creator.setConfiguration(getConfiguration());
         xmlCreator.setNextCreator(j5Creator);
-        
-        return xmlCreator;
-    }
 
-    boolean isJDK5andAbove() {
-        String v = System.getProperty("java.class.version", "44.0");
-        return "49.0".compareTo(v) <= 0;
+        return xmlCreator;
     }
 
     protected AbstractTypeCreator createRootTypeCreator() {
@@ -302,62 +254,63 @@
         // Create a Type Mapping for SOAP 1.1 Encoding
         TypeMapping soapTM = createTypeMapping(tm, false);
 
-        register(soapTM, boolean.class, ENCODED_BOOLEAN, new BooleanType());
-        register(soapTM, int.class, ENCODED_INT, new IntType());
-        register(soapTM, short.class, ENCODED_SHORT, new ShortType());
-        register(soapTM, double.class, ENCODED_DOUBLE, new DoubleType());
-        register(soapTM, float.class, ENCODED_FLOAT, new FloatType());
-        register(soapTM, long.class, ENCODED_LONG, new LongType());
-        register(soapTM, char.class, ENCODED_CHAR, new CharacterType());
-        register(soapTM, Character.class, ENCODED_CHAR, new CharacterType());
-        register(soapTM, String.class, ENCODED_STRING, new StringType());
-        register(soapTM, Boolean.class, ENCODED_BOOLEAN, new BooleanType());
-        register(soapTM, Integer.class, ENCODED_INT, new IntType());
-        register(soapTM, Short.class, ENCODED_SHORT, new ShortType());
-        register(soapTM, Double.class, ENCODED_DOUBLE, new DoubleType());
-        register(soapTM, Float.class, ENCODED_FLOAT, new FloatType());
-        register(soapTM, Long.class, ENCODED_LONG, new LongType());
-        register(soapTM, Date.class, ENCODED_DATETIME, new DateTimeType());
-        register(soapTM, java.sql.Date.class, ENCODED_DATETIME, new SqlDateType());
-        register(soapTM, Calendar.class, ENCODED_DATETIME, new CalendarType());
-        register(soapTM, byte[].class, ENCODED_BASE64, new Base64Type());
-        register(soapTM, BigDecimal.class, ENCODED_DECIMAL, new BigDecimalType());
-        register(soapTM, BigInteger.class, ENCODED_INTEGER, new BigIntegerType());
-
-        register(soapTM, boolean.class, XSD_BOOLEAN, new BooleanType());
-        register(soapTM, int.class, XSD_INT, new IntType());
-        register(soapTM, short.class, XSD_SHORT, new ShortType());
-        register(soapTM, double.class, XSD_DOUBLE, new DoubleType());
-        register(soapTM, float.class, XSD_FLOAT, new FloatType());
-        register(soapTM, long.class, XSD_LONG, new LongType());
-        register(soapTM, String.class, XSD_STRING, new StringType());
-        register(soapTM, Boolean.class, XSD_BOOLEAN, new BooleanType());
-        register(soapTM, Integer.class, XSD_INT, new IntType());
-        register(soapTM, Short.class, XSD_SHORT, new ShortType());
-        register(soapTM, Double.class, XSD_DOUBLE, new DoubleType());
-        register(soapTM, Float.class, XSD_FLOAT, new FloatType());
-        register(soapTM, Long.class, XSD_LONG, new LongType());
-        register(soapTM, Date.class, XSD_DATETIME, new DateTimeType());
-        register(soapTM, java.sql.Date.class, XSD_DATETIME, new SqlDateType());
-        register(soapTM, Time.class, XSD_TIME, new TimeType());
-        register(soapTM, Timestamp.class, XSD_DATETIME, new TimestampType());
-        register(soapTM, Calendar.class, XSD_DATETIME, new CalendarType());
-        register(soapTM, byte[].class, XSD_BASE64, new Base64Type());
-        register(soapTM, BigDecimal.class, XSD_DECIMAL, new BigDecimalType());
-        register(soapTM, URI.class, XSD_URI, new URIType());
-        register(soapTM, Document.class, XSD_ANY, new DocumentType());
-        register(soapTM, Source.class, XSD_ANY, new SourceType());
-        register(soapTM, XMLStreamReader.class, XSD_ANY, new XMLStreamReaderType());
-        register(soapTM, Element.class, XSD_ANY, new JDOMElementType());
-        register(soapTM, org.jdom.Document.class, XSD_ANY, new JDOMDocumentType());
-        register(soapTM, Object.class, XSD_ANY, new ObjectType());
+        register(soapTM, boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
+        register(soapTM, int.class, Soap11.ENCODED_INT, new IntType());
+        register(soapTM, short.class, Soap11.ENCODED_SHORT, new ShortType());
+        register(soapTM, double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
+        register(soapTM, float.class, Soap11.ENCODED_FLOAT, new FloatType());
+        register(soapTM, long.class, Soap11.ENCODED_LONG, new LongType());
+        register(soapTM, char.class, Soap11.ENCODED_CHAR, new CharacterType());
+        register(soapTM, Character.class, Soap11.ENCODED_CHAR, new CharacterType());
+        register(soapTM, String.class, Soap11.ENCODED_STRING, new StringType());
+        register(soapTM, Boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
+        register(soapTM, Integer.class, Soap11.ENCODED_INT, new IntType());
+        register(soapTM, Short.class, Soap11.ENCODED_SHORT, new ShortType());
+        register(soapTM, Double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
+        register(soapTM, Float.class, Soap11.ENCODED_FLOAT, new FloatType());
+        register(soapTM, Long.class, Soap11.ENCODED_LONG, new LongType());
+        register(soapTM, Date.class, Soap11.ENCODED_DATETIME, new DateTimeType());
+        register(soapTM, java.sql.Date.class, Soap11.ENCODED_DATETIME, new SqlDateType());
+        register(soapTM, Calendar.class, Soap11.ENCODED_DATETIME, new CalendarType());
+        register(soapTM, byte[].class, Soap11.ENCODED_BASE64, new Base64Type());
+        register(soapTM, BigDecimal.class, Soap11.ENCODED_DECIMAL, new BigDecimalType());
+        register(soapTM, BigInteger.class, Soap11.ENCODED_INTEGER, new BigIntegerType());
+
+        register(soapTM, boolean.class, XMLSchemaQNames.XSD_BOOLEAN, new BooleanType());
+        register(soapTM, int.class, XMLSchemaQNames.XSD_INT, new IntType());
+        register(soapTM, short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        register(soapTM, double.class, XMLSchemaQNames.XSD_DOUBLE, new DoubleType());
+        register(soapTM, float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        register(soapTM, long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+        register(soapTM, String.class, XMLSchemaQNames.XSD_STRING, new StringType());
+        register(soapTM, Boolean.class, XMLSchemaQNames.XSD_BOOLEAN, new BooleanType());
+        register(soapTM, Integer.class, XMLSchemaQNames.XSD_INT, new IntType());
+        register(soapTM, Short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        register(soapTM, Double.class, XMLSchemaQNames.XSD_DOUBLE, new DoubleType());
+        register(soapTM, Float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        register(soapTM, Long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+        register(soapTM, Date.class, XMLSchemaQNames.XSD_DATETIME, new DateTimeType());
+        register(soapTM, java.sql.Date.class, XMLSchemaQNames.XSD_DATETIME, new SqlDateType());
+        register(soapTM, Time.class, XMLSchemaQNames.XSD_TIME, new TimeType());
+        register(soapTM, Timestamp.class, XMLSchemaQNames.XSD_DATETIME, new TimestampType());
+        register(soapTM, Calendar.class, XMLSchemaQNames.XSD_DATETIME, new CalendarType());
+        register(soapTM, byte[].class, XMLSchemaQNames.XSD_BASE64, new Base64Type());
+        register(soapTM, BigDecimal.class, XMLSchemaQNames.XSD_DECIMAL, new BigDecimalType());
+        register(soapTM, URI.class, XMLSchemaQNames.XSD_URI, new URIType());
+        register(soapTM, Document.class, XMLSchemaQNames.XSD_ANY, new DocumentType());
+        register(soapTM, Source.class, XMLSchemaQNames.XSD_ANY, new SourceType());
+        register(soapTM, XMLStreamReader.class, XMLSchemaQNames.XSD_ANY, new XMLStreamReaderType());
+        register(soapTM, Element.class, XMLSchemaQNames.XSD_ANY, new JDOMElementType());
+        register(soapTM, org.jdom.Document.class, XMLSchemaQNames.XSD_ANY, new JDOMDocumentType());
+        register(soapTM, Object.class, XMLSchemaQNames.XSD_ANY, new ObjectType());
         // unless there is customization, we use no expectedContentTypes.
-        register(soapTM, DataSource.class, XSD_BASE64, new DataSourceType(enableMtomXmime,
null));
-        register(soapTM, DataHandler.class, XSD_BASE64, new DataHandlerType(enableMtomXmime,
null));
-        register(soapTM, BigInteger.class, XSD_INTEGER, new BigIntegerType());
-
-        register(ENCODED_NS, soapTM);
+        register(soapTM, DataSource.class, XMLSchemaQNames.XSD_BASE64, new DataSourceType(enableMtomXmime,
+                                                                                        
 null));
+        register(soapTM, DataHandler.class, XMLSchemaQNames.XSD_BASE64, new DataHandlerType(enableMtomXmime,
+                                                                                        
   null));
+        register(soapTM, BigInteger.class, XMLSchemaQNames.XSD_INTEGER, new BigIntegerType());
 
+        register(Soap11.SOAP_ENCODING_URI, soapTM);
         register(SOAPConstants.XSD, tm);
         registerDefault(tm);
 
@@ -367,74 +320,71 @@
     protected void createDefaultMappings(TypeMapping tm) {
         createDefaultMappings(false, tm);
     }
-    
+
     protected void createDefaultMappings(boolean enableMtomXmime, TypeMapping tm) {
-        register(tm, boolean.class, XSD_BOOLEAN, new BooleanType());
-        register(tm, int.class, XSD_INT, new IntType());
-        register(tm, short.class, XSD_SHORT, new ShortType());
-        register(tm, double.class, XSD_DOUBLE, new DoubleType());
-        register(tm, float.class, XSD_FLOAT, new FloatType());
-        register(tm, long.class, XSD_LONG, new LongType());
-        register(tm, char.class, XSD_STRING, new CharacterType());
-        register(tm, Character.class, XSD_STRING, new CharacterType());
-        register(tm, String.class, XSD_STRING, new StringType());
-        register(tm, Boolean.class, XSD_BOOLEAN, new BooleanType());
-        register(tm, Integer.class, XSD_INT, new IntType());
-        register(tm, Short.class, XSD_SHORT, new ShortType());
-        register(tm, Double.class, XSD_DOUBLE, new DoubleType());
-        register(tm, Float.class, XSD_FLOAT, new FloatType());
-        register(tm, Long.class, XSD_LONG, new LongType());
-        register(tm, Date.class, XSD_DATETIME, new DateTimeType());
-        register(tm, java.sql.Date.class, XSD_DATETIME, new SqlDateType());
-        register(tm, Time.class, XSD_TIME, new TimeType());
-        register(tm, Timestamp.class, XSD_DATETIME, new TimestampType());
-        register(tm, Calendar.class, XSD_DATETIME, new CalendarType());
-        register(tm, byte[].class, XSD_BASE64, new Base64Type());
-        register(tm, BigDecimal.class, XSD_DECIMAL, new BigDecimalType());
-        register(tm, BigInteger.class, XSD_INTEGER, new BigIntegerType());
-        register(tm, URI.class, XSD_URI, new URIType());
-        register(tm, Document.class, XSD_ANY, new DocumentType());
-        register(tm, Source.class, XSD_ANY, new SourceType());
-        register(tm, XMLStreamReader.class, XSD_ANY, new XMLStreamReaderType());
-        register(tm, Element.class, XSD_ANY, new JDOMElementType());
-        register(tm, org.jdom.Document.class, XSD_ANY, new JDOMDocumentType());
-        register(tm, Object.class, XSD_ANY, new ObjectType());
+        register(tm, boolean.class, XMLSchemaQNames.XSD_BOOLEAN, new BooleanType());
+        register(tm, int.class, XMLSchemaQNames.XSD_INT, new IntType());
+        register(tm, short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        register(tm, double.class, XMLSchemaQNames.XSD_DOUBLE, new DoubleType());
+        register(tm, float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        register(tm, long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+        register(tm, char.class, XMLSchemaQNames.XSD_STRING, new CharacterType());
+        register(tm, Character.class, XMLSchemaQNames.XSD_STRING, new CharacterType());
+        register(tm, String.class, XMLSchemaQNames.XSD_STRING, new StringType());
+        register(tm, Boolean.class, XMLSchemaQNames.XSD_BOOLEAN, new BooleanType());
+        register(tm, Integer.class, XMLSchemaQNames.XSD_INT, new IntType());
+        register(tm, Short.class, XMLSchemaQNames.XSD_SHORT, new ShortType());
+        register(tm, Double.class, XMLSchemaQNames.XSD_DOUBLE, new DoubleType());
+        register(tm, Float.class, XMLSchemaQNames.XSD_FLOAT, new FloatType());
+        register(tm, Long.class, XMLSchemaQNames.XSD_LONG, new LongType());
+        register(tm, Date.class, XMLSchemaQNames.XSD_DATETIME, new DateTimeType());
+        register(tm, java.sql.Date.class, XMLSchemaQNames.XSD_DATETIME, new SqlDateType());
+        register(tm, Time.class, XMLSchemaQNames.XSD_TIME, new TimeType());
+        register(tm, Timestamp.class, XMLSchemaQNames.XSD_DATETIME, new TimestampType());
+        register(tm, Calendar.class, XMLSchemaQNames.XSD_DATETIME, new CalendarType());
+        register(tm, byte[].class, XMLSchemaQNames.XSD_BASE64, new Base64Type());
+        register(tm, BigDecimal.class, XMLSchemaQNames.XSD_DECIMAL, new BigDecimalType());
+        register(tm, BigInteger.class, XMLSchemaQNames.XSD_INTEGER, new BigIntegerType());
+        register(tm, URI.class, XMLSchemaQNames.XSD_URI, new URIType());
+        register(tm, Document.class, XMLSchemaQNames.XSD_ANY, new DocumentType());
+        register(tm, Source.class, XMLSchemaQNames.XSD_ANY, new SourceType());
+        register(tm, XMLStreamReader.class, XMLSchemaQNames.XSD_ANY, new XMLStreamReaderType());
+        register(tm, Element.class, XMLSchemaQNames.XSD_ANY, new JDOMElementType());
+        register(tm, org.jdom.Document.class, XMLSchemaQNames.XSD_ANY, new JDOMDocumentType());
+        register(tm, Object.class, XMLSchemaQNames.XSD_ANY, new ObjectType());
 
-        QName mtomBase64 = XSD_BASE64;
+        QName mtomBase64 = XMLSchemaQNames.XSD_BASE64;
         if (enableMtomXmime) {
             mtomBase64 = AbstractXOPType.XML_MIME_BASE64;
         }
-        
-        
-        register(tm, DataSource.class, mtomBase64, 
-                 new DataSourceType(enableMtomXmime, null));
-        register(tm, DataHandler.class, mtomBase64,
-                 new DataHandlerType(enableMtomXmime, null));
-
-        if (isJDK5andAbove()) {
-            registerIfAvailable(tm, "javax.xml.datatype.Duration", XSD_DURATION,
-                                "org.apache.cxf.aegis.type.java5.DurationType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_DATE,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_TIME,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_DAY,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_MONTH,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_MONTH_DAY,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_YEAR,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_YEAR_MONTH,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-            registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_DATETIME,
-                                "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
-        }
-    }
 
-    protected void registerIfAvailable(TypeMapping tm, String className,
-                                       QName typeName, String typeClassName) {
+        register(tm, DataSource.class, mtomBase64, new DataSourceType(enableMtomXmime, null));
+        register(tm, DataHandler.class, mtomBase64, new DataHandlerType(enableMtomXmime,
null));
+
+        registerIfAvailable(tm, "javax.xml.datatype.Duration", XMLSchemaQNames.XSD_DURATION,
+                            "org.apache.cxf.aegis.type.java5.DurationType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_DATE,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_TIME,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_G_DAY,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_G_MONTH,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_G_MONTH_DAY,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_G_YEAR,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_G_YEAR_MONTH,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+        registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XMLSchemaQNames.XSD_DATETIME,
+                            "org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType");
+    }
+
+    protected void registerIfAvailable(TypeMapping tm, 
+                                       String className, 
+                                       QName typeName, 
+                                       String typeClassName) {
         try {
             Class cls = ClassLoaderUtils.loadClass(className, getClass());
             Class typeCls = ClassLoaderUtils.loadClass(typeClassName, getClass());



Mime
View raw message