cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r809790 [1/3] - in /cxf/trunk/rt: databinding/aegis/src/main/java/org/apache/cxf/aegis/ databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ databinding/aegis/src/main/...
Date Tue, 01 Sep 2009 01:13:10 GMT
Author: bimargulies
Date: Tue Sep  1 01:13:06 2009
New Revision: 809790

URL: http://svn.apache.org/viewvc?rev=809790&view=rev
Log:
Merge branch 'aegispadb' into trunk

Added:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java   (contents, props changed)
      - copied, changed from r809738, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/topLevelList.xml   (with props)
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/topLevelListWithXsiType.xml   (with props)
Removed:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Messages.properties
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMapping.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/Base64Type.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BooleanType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DoubleType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/FloatType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/IntType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/LongType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/SqlDateType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/StringType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimezoneLessDateType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/XMLBeanTypeInfo.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfo.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/StructType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/TrailingBlocks.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XmlAttribute.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XmlElement.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XmlParamType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XmlReturnType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XmlType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/DocumentType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMDocumentType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/JDOMElementType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/SourceType.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/xml/XMLStreamReaderType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/types/NoDefaultConstructorBeanKeyType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/types/NoDefaultConstructorBeanType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/namespaces/NamespaceConfusionTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneReadTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneWriteTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/ConfigurationTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbXmlParamTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/MapTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XmlParamTypeTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/xmlconfig/TestDateMapping.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractAegisProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisElementProvider.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisContext.java Tue Sep  1 01:13:06 2009
@@ -19,6 +19,9 @@
 package org.apache.cxf.aegis;
 
 import java.io.IOException;
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -34,9 +37,9 @@
 import org.xml.sax.SAXException;
 
 import org.apache.cxf.aegis.type.AbstractTypeCreator;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.DefaultTypeCreator;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
-import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeCreator;
 import org.apache.cxf.aegis.type.TypeMapping;
@@ -82,11 +85,11 @@
     private boolean readXsiTypes = true;
 
     private Set<String> rootClassNames;
-    private Set<Class<?>> rootClasses;
+    private Set<java.lang.reflect.Type> rootClasses;
     private Set<QName> rootTypeQNames;
     // this type mapping is the front of the chain of delegating type mappings.
     private TypeMapping typeMapping;
-    private Set<Type> rootTypes;
+    private Set<AegisType> rootTypes;
     private Map<Class<?>, String> beanImplementationMap;
     private TypeCreationOptions configuration;
     private boolean mtomEnabled;
@@ -100,7 +103,7 @@
      */
     public AegisContext() {
         beanImplementationMap = new HashMap<Class<?>, String>();
-        rootClasses = new HashSet<Class<?>>();
+        rootClasses = new HashSet<java.lang.reflect.Type>();
         rootTypeQNames = new HashSet<QName>();
     }
 
@@ -171,12 +174,12 @@
     }
 
     /**
-     * If a class was provided as part of the 'root' list, retrieve it's Type by Class.
+     * If a class was provided as part of the 'root' list, retrieve it's AegisType by Class.
      * 
      * @param clazz
      * @return
      */
-    public Type getRootType(Class clazz) {
+    public AegisType getRootType(Class clazz) {
         if (rootClasses.contains(clazz)) {
             return typeMapping.getType(clazz);
         } else {
@@ -185,18 +188,46 @@
     }
 
     /**
-     * If a class was provided as part of the root list, retrieve it's Type by schema type QName.
+     * If a class was provided as part of the root list, retrieve it's AegisType by schema type QName.
      * 
      * @param schemaTypeName
      * @return
      */
-    public Type getRootType(QName schemaTypeName) {
+    public AegisType getRootType(QName schemaTypeName) {
         if (rootTypeQNames.contains(schemaTypeName)) {
             return typeMapping.getType(schemaTypeName);
         } else {
             return null;
         }
     }
+    
+    private Set<Class<?>> rootMappableClasses() {
+        Set<Class<?>> mappableClasses = new HashSet<Class<?>>();
+        for (java.lang.reflect.Type jtype : rootClasses) {
+            addTypeToMappableClasses(mappableClasses, jtype);
+        }
+        return mappableClasses;
+    }
+
+    private void addTypeToMappableClasses(Set<Class<?>> mappableClasses, java.lang.reflect.Type jtype) {
+        if (jtype instanceof Class) {
+            Class<?> jclass = (Class<?>) jtype;
+            if (jclass.isArray()) {
+                mappableClasses.add(jclass.getComponentType());
+            }
+            mappableClasses.add(jclass);
+        } else if (jtype instanceof ParameterizedType) {
+            for (java.lang.reflect.Type t2 : ((ParameterizedType)jtype).getActualTypeArguments()) {
+                addTypeToMappableClasses(mappableClasses, t2);
+            }
+        } else if (jtype instanceof GenericArrayType) {
+            GenericArrayType gt = (GenericArrayType)jtype;
+            Class ct = (Class) gt.getGenericComponentType();
+            // this looks nutty, but there's no other way. Make an array and take it's class.
+            ct = Array.newInstance(ct, 0).getClass();
+            rootClasses.add(ct);
+        }
+    }
 
     /**
      * Examine a list of override classes, and register all of them.
@@ -205,10 +236,10 @@
      * @param classes list of class names
      */
     private void processRootTypes() {
-        rootTypes = new HashSet<Type>();
+        rootTypes = new HashSet<AegisType>();
         // app may have already supplied classes.
         if (rootClasses == null) {
-            rootClasses = new HashSet<Class<?>>();
+            rootClasses = new HashSet<java.lang.reflect.Type>();
         }
         rootTypeQNames = new HashSet<QName>();
         if (this.rootClassNames != null) {
@@ -224,8 +255,32 @@
             }
         }
 
-        for (Class<?> c : rootClasses) {
-            Type t = typeMapping.getType(c);
+        // This is a list of AegisType rather than Class so that it can set up for generic collections.
+        // When we see a generic, we process both the generic outer class and each parameter class.
+        // This is not the same thing as allowing mappings of arbitrary x<q> types.
+        
+        Set<Class<?>> rootMappableClassSet = rootMappableClasses();
+        /*
+         * First loop: process non-Class roots, creating full types for them
+         * and registering them.
+         */
+        for (java.lang.reflect.Type reflectType : rootClasses) {
+            if (!(reflectType instanceof Class)) {
+                // if it's not a Class, it can't be mapped from Class to type in the mapping.
+                // so we create 
+                AegisType aegisType = typeMapping.getTypeCreator().createType(reflectType);
+                typeMapping.register(aegisType);
+                // note: we don't handle arbitrary generics, so no BeanType 
+                // check here.
+                rootTypeQNames.add(aegisType.getSchemaType());
+            } 
+        }
+        /*
+         * Second loop: process Class roots, including those derived from 
+         * generic types, creating when not in the default mappings.
+         */
+        for (Class<?> c : rootMappableClassSet) {
+            AegisType t = typeMapping.getType(c);
             if (t == null) {
                 t = typeMapping.getTypeCreator().createType(c);
                 typeMapping.register(t);
@@ -390,7 +445,7 @@
      * 
      * @return the set of type objects.
      */
-    public Set<Type> getRootTypes() {
+    public Set<AegisType> getRootTypes() {
         return rootTypes;
     }
 
@@ -409,7 +464,7 @@
         this.beanImplementationMap = beanImplementationMap;
     }
 
-    public Set<Class<?>> getRootClasses() {
+    public Set<java.lang.reflect.Type> getRootClasses() {
         return rootClasses;
     }
 
@@ -418,7 +473,7 @@
      * 
      * @param rootClasses
      */
-    public void setRootClasses(Set<Class<?>> rootClasses) {
+    public void setRootClasses(Set<java.lang.reflect.Type> rootClasses) {
         this.rootClasses = rootClasses;
     }
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataReader.java Tue Sep  1 01:13:06 2009
@@ -21,7 +21,7 @@
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.staxutils.W3CDOMStreamReader;
 
 public class AegisElementDataReader extends AbstractAegisIoImpl 
@@ -44,7 +44,7 @@
         return reader.read(sreader);
     }
     
-    public Object read(Element input, Type desiredType) throws Exception {
+    public Object read(Element input, AegisType desiredType) throws Exception {
         W3CDOMStreamReader sreader = new W3CDOMStreamReader(input);
         sreader.nextTag(); //advance into the first tag
         return reader.read(sreader, desiredType);

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataWriter.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataWriter.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisElementDataWriter.java Tue Sep  1 01:13:06 2009
@@ -22,7 +22,7 @@
 import javax.xml.namespace.QName;
 import org.w3c.dom.Element;
 
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 
 /**
@@ -38,9 +38,16 @@
         writer = new AegisXMLStreamDataWriter(globalContext);
     }
 
-    public void write(Object obj, QName elementName, boolean optional, Element output, Type aegisType)
+    public void write(Object obj, QName elementName, boolean optional, Element output, AegisType aegisType)
         throws Exception {
         W3CDOMStreamWriter swriter = new W3CDOMStreamWriter(output);
         writer.write(obj, elementName, optional, swriter, aegisType);
     }
+
+    public void write(Object obj, QName elementName, boolean optional, Element output,
+                      java.lang.reflect.Type objectType) throws Exception {
+        W3CDOMStreamWriter swriter = new W3CDOMStreamWriter(output);
+        writer.write(obj, elementName, optional, swriter, objectType);
+        
+    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisReader.java Tue Sep  1 01:13:06 2009
@@ -18,7 +18,7 @@
  */
 package org.apache.cxf.aegis;
 
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 
 /**
  * Interface for Aegis readers.
@@ -40,6 +40,6 @@
      * @return
      * @throws Exception
      */
-    Object read(ReaderT reader, Type desiredType) throws Exception;
+    Object read(ReaderT reader, AegisType desiredType) throws Exception;
 
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisWriter.java Tue Sep  1 01:13:06 2009
@@ -20,7 +20,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 
 /**
  * Interface for Aegis writers.
@@ -41,5 +41,21 @@
                QName elementName,
                boolean optional,
                SinkT output, 
-               Type aegisType) throws Exception;
+               AegisType aegisType) throws Exception;
+    
+    /**
+     * Write an object to the sink, providing a {@link java.lang.reflect.Type} to specify
+     * its type.
+     * @param obj the object
+     * @param elementName XML element name
+     * @param optional true if null maps to no output at all.
+     * @param output where to put it.
+     * @param objectType A description of the type of the object.
+     * @throws Exception
+     */
+    void write(Object obj,
+               QName elementName,
+               boolean optional,
+               SinkT output,
+               java.lang.reflect.Type objectType) throws Exception;
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataReader.java Tue Sep  1 01:13:06 2009
@@ -23,7 +23,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamReader;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.type.basic.ArrayType;
 import org.apache.cxf.aegis.xml.stax.ElementReader;
@@ -65,7 +65,7 @@
     }
     
     /** {@inheritDoc}*/
-    public Object read(XMLStreamReader reader, Type desiredType) throws Exception {
+    public Object read(XMLStreamReader reader, AegisType desiredType) throws Exception {
         setupReaderPosition(reader);
         ElementReader elReader = new ElementReader(reader);
 
@@ -74,7 +74,7 @@
             return null;
         }
         
-        Type type = TypeUtil.getReadTypeStandalone(reader, aegisContext, desiredType);
+        AegisType type = TypeUtil.getReadTypeStandalone(reader, aegisContext, desiredType);
         
         if (type == null) {
             throw new DatabindingException(new Message("NO_MAPPING", LOG));

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/AegisXMLStreamDataWriter.java Tue Sep  1 01:13:06 2009
@@ -23,7 +23,8 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
+import org.apache.cxf.aegis.type.TypeCreator;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.xml.MessageWriter;
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
@@ -44,22 +45,39 @@
      * @param elementName the QName of the XML Element.
      * @param optional set this for minOccurs = 0. It omits null elements.
      * @param output the output stream
-     * @param aegisType the aegis type.
+     * @param aegisType the aegis type. This may be null if the object is non-null
+     * and the type of the object is covered in the mapping. Warning, for collections
+     * this will not do what you want, you must call the alternative version of 
+     * write that takes a {@link java.lang.reflect.Type}. 
      * @throws Exception
      */
     public void write(Object obj, 
                       QName elementName,
                       boolean optional,
                       XMLStreamWriter output, 
-                      Type aegisType) throws Exception {
+                      AegisType aegisType) throws Exception {
         
         if (obj == null && aegisType == null && !optional) {
-            Message message = new Message("WRITE_NEEDS_TYPE", LOG);
+            Message message = new Message("WRITE_NULL_NEEDS_TYPE", LOG);
             throw new DatabindingException(message);
         }
-        
+
         if (obj != null && aegisType == null) {
-            aegisType = TypeUtil.getWriteType(aegisContext, obj, aegisType);
+            aegisType = getContext().getTypeMapping().getType(obj.getClass());
+            if (aegisType == null) {
+                TypeCreator creator = getContext().getTypeMapping().getTypeCreator();
+                aegisType = creator.createType(obj.getClass());
+            }
+        }
+        
+        if (obj != null) {
+            // look for overrides declared in the context.
+            aegisType = TypeUtil.getWriteType(aegisContext, obj, aegisType); 
+        }
+        
+        if (aegisType == null) {
+            Message message = new Message("WRITE_NEEDS_TYPE", LOG, obj);
+            throw new DatabindingException(message);
         }
         
         if (obj == null) {
@@ -86,4 +104,26 @@
         aegisType.writeObject(obj, w2, context);
         w2.close();
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(Object obj, QName elementName, boolean optional, XMLStreamWriter output,
+                      java.lang.reflect.Type objectType) throws Exception {
+        AegisType aegisType = null;
+        if (objectType instanceof Class) {
+            aegisType = getContext().getTypeMapping().getType((Class)objectType);
+        }
+        if (aegisType == null) {
+            TypeCreator creator = getContext().getTypeMapping().getTypeCreator();
+            aegisType = creator.createType(objectType);
+        }
+        
+        if (aegisType == null) {
+            Message message = new Message("NO_MAPPING_FOR_TYPE", LOG, objectType);
+            throw new DatabindingException(message);
+        }
+        write(obj, elementName, optional, output, aegisType);
+        
+    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Messages.properties?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Messages.properties (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Messages.properties Tue Sep  1 01:13:06 2009
@@ -22,4 +22,8 @@
 STREAM_READ_ERROR=Error reading XML input stream.
 MAPPED_CLASS_NOT_FOUND=Class {0} from service property {1} not found.
 NO_MAPPING=No mapping found for XML input.
+WRITE_NEEDS_TYPE=No mapping found for Java object {0}, type must be supplied.
+WRITE_NULL_NEEDS_TYPE=A type must be specified to write a non-optional null.
+NO_MAPPING_FOR_TYPE=Cannot map {0} to XML.
+
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java Tue Sep  1 01:13:06 2009
@@ -35,7 +35,7 @@
 
 import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeClassInfo;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.TypeCreator;
@@ -101,7 +101,7 @@
     private static final Logger LOG = LogUtils.getL7dLogger(AegisDatabinding.class);
 
     private AegisContext aegisContext;
-    private Map<MessagePartInfo, Type> part2Type;
+    private Map<MessagePartInfo, AegisType> part2Type;
     private Service service;
     private boolean isInitialized;
     private Set<String> overrideTypes;
@@ -111,7 +111,7 @@
 
     public AegisDatabinding() {
         super();
-        part2Type = new HashMap<MessagePartInfo, Type>();
+        part2Type = new HashMap<MessagePartInfo, AegisType>();
     }
 
     /**
@@ -263,7 +263,7 @@
         s.getInInterceptors()
             .add(new AegisSchemaValidationInInterceptor(getBus(), s.getServiceInfos().get(0)));
 
-        Set<Type> deps = new HashSet<Type>();
+        Set<AegisType> deps = new HashSet<AegisType>();
 
         for (ServiceInfo info : s.getServiceInfos()) {
             for (OperationInfo opInfo : info.getInterface().getOperations()) {
@@ -276,10 +276,10 @@
             }
         }
 
-        Collection<Type> additional = aegisContext.getRootTypes();
+        Collection<AegisType> additional = aegisContext.getRootTypes();
 
         if (additional != null) {
-            for (Type t : additional) {
+            for (AegisType t : additional) {
                 if (!deps.contains(t)) {
                     deps.add(t);
                 }
@@ -299,7 +299,8 @@
         }
     }
 
-    private void initializeOperation(Service s, TypeMapping serviceTM, OperationInfo opInfo, Set<Type> deps) {
+    private void initializeOperation(Service s, TypeMapping serviceTM, OperationInfo opInfo, 
+                                     Set<AegisType> deps) {
         try {
             initializeMessage(s, serviceTM, opInfo.getInput(), IN_PARAM, deps);
 
@@ -336,14 +337,14 @@
     }
 
     protected void initializeMessage(Service s, TypeMapping serviceTM, AbstractMessageContainer container,
-                                     int partType, Set<Type> deps) {
+                                     int partType, Set<AegisType> deps) {
         if (container == null) {
             return;
         }
         for (Iterator itr = container.getMessageParts().iterator(); itr.hasNext();) {
             MessagePartInfo part = (MessagePartInfo)itr.next();
 
-            Type type = getParameterType(s, serviceTM, part, partType);
+            AegisType type = getParameterType(s, serviceTM, part, partType);
 
             if (part.getXmlSchema() == null) {
                 // schema hasn't been filled in yet
@@ -402,10 +403,10 @@
         }
     }
 
-    private void addDependencies(Set<Type> deps, Type type) {
-        Set<Type> typeDeps = type.getDependencies();
+    private void addDependencies(Set<AegisType> deps, AegisType type) {
+        Set<AegisType> typeDeps = type.getDependencies();
         if (typeDeps != null) {
-            for (Type t : typeDeps) {
+            for (AegisType t : typeDeps) {
                 if (!deps.contains(t)) {
                     deps.add(t);
                     addDependencies(deps, t);
@@ -414,14 +415,14 @@
         }
     }
 
-    private void createSchemas(Service s, Set<Type> deps) {
+    private void createSchemas(Service s, Set<AegisType> deps) {
 
-        Map<String, Set<Type>> tns2Type = new HashMap<String, Set<Type>>();
-        for (Type t : deps) {
+        Map<String, Set<AegisType>> tns2Type = new HashMap<String, Set<AegisType>>();
+        for (AegisType t : deps) {
             String ns = t.getSchemaType().getNamespaceURI();
-            Set<Type> types = tns2Type.get(ns);
+            Set<AegisType> types = tns2Type.get(ns);
             if (types == null) {
-                types = new HashSet<Type>();
+                types = new HashSet<AegisType>();
                 tns2Type.put(ns, types);
             }
             types.add(t);
@@ -442,7 +443,7 @@
             boolean needXmimeSchema = false;
             boolean needTypesSchema = false;
 
-            for (Map.Entry<String, Set<Type>> entry : tns2Type.entrySet()) {
+            for (Map.Entry<String, Set<AegisType>> entry : tns2Type.entrySet()) {
 
                 String schemaNamespaceUri = entry.getKey();
 
@@ -487,7 +488,7 @@
                 schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
                 schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
 
-                for (Type t : entry.getValue()) {
+                for (AegisType t : entry.getValue()) {
                     try {
                         t.writeSchema(schema);
                     } catch (XmlSchemaException ex) {
@@ -547,7 +548,7 @@
         // No mapped name was specified, so if its a complex type use that name
         // instead
         if (name == null) {
-            Type type = tm.getTypeCreator().createType(m, param);
+            AegisType type = tm.getTypeCreator().createType(m, param);
 
             if (type.isComplex() && !type.isAbstract()) {
                 name = type.getSchemaType();
@@ -557,8 +558,8 @@
         return name;
     }
 
-    private Type getParameterType(Service s, TypeMapping tm, MessagePartInfo param, int paramtype) {
-        Type type = tm.getType(param.getTypeQName());
+    private AegisType getParameterType(Service s, TypeMapping tm, MessagePartInfo param, int paramtype) {
+        AegisType type = tm.getType(param.getTypeQName());
 
         int offset = 0;
         if (paramtype == OUT_PARAM) {
@@ -647,12 +648,12 @@
         return smd != null ? smd.getPrimaryMethod(op) : null;
     }
 
-    public Type getType(MessagePartInfo part) {
+    public AegisType getType(MessagePartInfo part) {
         return part2Type.get(part);
     }
 
     public MessagePartInfo getPartFromClass(Class<?> cls) {
-        for (Map.Entry<MessagePartInfo, Type> entry : part2Type.entrySet()) {
+        for (Map.Entry<MessagePartInfo, AegisType> entry : part2Type.entrySet()) {
             if (entry.getValue().getTypeClass() == cls) {
                 return entry.getKey();
             }
@@ -660,8 +661,8 @@
         return null;
     }
 
-    public Type getTypeFromClass(Class<?> cls) {
-        for (Type t : part2Type.values()) {
+    public AegisType getTypeFromClass(Class<?> cls) {
+        for (AegisType t : part2Type.values()) {
             if (t.getTypeClass() == cls) {
                 return t;
             }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java Tue Sep  1 01:13:06 2009
@@ -27,7 +27,7 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.aegis.AegisElementDataReader;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
@@ -60,7 +60,7 @@
     /** {@inheritDoc}*/
     public Object read(MessagePartInfo part, Element input) {
         try {
-            Type type = databinding.getType(part);
+            AegisType type = databinding.getType(part);
             return reader.read(input, type);
         } catch (Exception e) {
             throw new Fault(e);

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java Tue Sep  1 01:13:06 2009
@@ -30,7 +30,7 @@
 
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.xml.MessageWriter;
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
@@ -64,7 +64,7 @@
     }
 
     public void write(Object obj, MessagePartInfo part, Element output) {
-        Type type = databinding.getType(part);
+        AegisType type = databinding.getType(part);
 
         if (type == null) {
             throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG));

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java Tue Sep  1 01:13:06 2009
@@ -26,7 +26,7 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.aegis.AegisXMLStreamDataReader;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.basic.ArrayType;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
@@ -45,7 +45,7 @@
     
     public Object read(MessagePartInfo part, XMLStreamReader input) {
         try {
-            Type type = part.getProperty("org.apache.cxf.aegis.outerType", Type.class);
+            AegisType type = part.getProperty("org.apache.cxf.aegis.outerType", AegisType.class);
             if (type == null) {
                 type = databinding.getType(part);
                 return reader.read(input, type); 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java Tue Sep  1 01:13:06 2009
@@ -29,7 +29,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.type.basic.ArrayType;
 import org.apache.cxf.aegis.xml.MessageWriter;
@@ -62,7 +62,7 @@
     }
 
     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
-        Type type = databinding.getType(part);
+        AegisType type = databinding.getType(part);
         if (type == null) {
             type = databinding.getTypeFromClass(obj.getClass());
         }
@@ -79,9 +79,9 @@
          * We arrive here with a 'type' of the inner type if isWriteOuter is null.
          * However, in that case, the original type is available. 
          */
-        Type outerType  = null;
+        AegisType outerType  = null;
         if (part != null) {
-            outerType = part.getProperty("org.apache.cxf.aegis.outerType", Type.class);
+            outerType = part.getProperty("org.apache.cxf.aegis.outerType", AegisType.class);
         }
         try {
             if (obj == null) {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java Tue Sep  1 01:13:06 2009
@@ -100,9 +100,9 @@
         return info;
     }
 
-    public Type createTypeForClass(TypeClassInfo info) {
+    public AegisType createTypeForClass(TypeClassInfo info) {
         Class javaType = info.getTypeClass();
-        Type result = null;
+        AegisType result = null;
         boolean newType = true;
 
         if (info.getType() != null) {
@@ -118,7 +118,7 @@
         } else if (isEnum(javaType)) {
             result = createEnumType(info);
         } else {
-            Type type = getTypeMapping().getType(javaType);
+            AegisType type = getTypeMapping().getType(javaType);
             if (type == null) {
                 if (info.getTypeName() != null) {
                     type = getTypeMapping().getType(info.getTypeName());
@@ -148,7 +148,7 @@
         return "javax.xml.ws.Holder".equals(javaType.getName());
     }
 
-    protected Type createHolderType(TypeClassInfo info) {
+    protected AegisType createHolderType(TypeClassInfo info) {
         if (info.getGenericType() == null) {
             throw new UnsupportedOperationException("To use holder types "
                     + "you must have an XML descriptor declaring the component type.");
@@ -165,9 +165,9 @@
         return javaType.isArray() && !javaType.equals(byte[].class);
     }
 
-    protected Type createUserType(TypeClassInfo info) {
+    protected AegisType createUserType(TypeClassInfo info) {
         try {
-            Type type = (Type)info.getType().newInstance();
+            AegisType type = (AegisType)info.getType().newInstance();
 
             QName name = info.getTypeName();
             if (name == null) {
@@ -197,7 +197,7 @@
         }
     }
 
-    protected Type createArrayType(TypeClassInfo info) {
+    protected AegisType createArrayType(TypeClassInfo info) {
         ArrayType type = new ArrayType();
         type.setTypeMapping(getTypeMapping());
         type.setTypeClass(info.getTypeClass());
@@ -231,8 +231,8 @@
         return Collection.class.isAssignableFrom(javaType);
     }
 
-    protected Type createCollectionTypeFromGeneric(TypeClassInfo info) {
-        Type component = getOrCreateGenericType(info);
+    protected AegisType createCollectionTypeFromGeneric(TypeClassInfo info) {
+        AegisType component = getOrCreateGenericType(info);
 
         CollectionType type = new CollectionType(component);
         type.setTypeMapping(getTypeMapping());
@@ -258,15 +258,15 @@
         return type;
     }
 
-    protected Type getOrCreateGenericType(TypeClassInfo info) {
+    protected AegisType getOrCreateGenericType(TypeClassInfo info) {
         return createObjectType();
     }
 
-    protected Type getOrCreateMapKeyType(TypeClassInfo info) {
+    protected AegisType getOrCreateMapKeyType(TypeClassInfo info) {
         return nextCreator.getOrCreateMapKeyType(info);
     }
 
-    protected Type createObjectType() {
+    protected AegisType createObjectType() {
         ObjectType type = new ObjectType();
         type.setSchemaType(XMLSchemaQNames.XSD_ANY);
         type.setTypeClass(Object.class);
@@ -274,11 +274,11 @@
         return type;
     }
 
-    protected Type getOrCreateMapValueType(TypeClassInfo info) {
+    protected AegisType getOrCreateMapValueType(TypeClassInfo info) {
         return nextCreator.getOrCreateMapValueType(info);
     }
 
-    protected Type createMapType(TypeClassInfo info, Type keyType, Type valueType) {
+    protected AegisType createMapType(TypeClassInfo info, AegisType keyType, AegisType valueType) {
         QName schemaType = createMapQName(info, keyType, valueType);
         MapType type = new MapType(schemaType, keyType, valueType);
         type.setTypeMapping(getTypeMapping());
@@ -287,14 +287,14 @@
         return type;
     }
 
-    protected Type createMapType(TypeClassInfo info) {
-        Type keyType = getOrCreateMapKeyType(info);
-        Type valueType = getOrCreateMapValueType(info);
+    protected AegisType createMapType(TypeClassInfo info) {
+        AegisType keyType = getOrCreateMapKeyType(info);
+        AegisType valueType = getOrCreateMapValueType(info);
 
         return createMapType(info, keyType, valueType);
     }
 
-    protected QName createMapQName(TypeClassInfo info, Type keyType, Type valueType) {
+    protected QName createMapQName(TypeClassInfo info, AegisType keyType, AegisType valueType) {
         String name = keyType.getSchemaType().getLocalPart() + '2' + valueType.getSchemaType().getLocalPart()
                       + "Map";
 
@@ -312,15 +312,15 @@
         return false;
     }
 
-    public Type createEnumType(TypeClassInfo info) {
+    public AegisType createEnumType(TypeClassInfo info) {
         return null;
     }
 
-    public abstract Type createCollectionType(TypeClassInfo info);
+    public abstract AegisType createCollectionType(TypeClassInfo info);
 
-    public abstract Type createDefaultType(TypeClassInfo info);
+    public abstract AegisType createDefaultType(TypeClassInfo info);
 
-    protected QName createCollectionQName(TypeClassInfo info, Type type) {
+    protected QName createCollectionQName(TypeClassInfo info, AegisType type) {
         String ns;
 
         if (type.isComplex()) {
@@ -355,13 +355,13 @@
     public abstract TypeClassInfo createClassInfo(Method m, int index);
 
     /**
-     * Create a Type for a Method parameter.
+     * Create a AegisType for a Method parameter.
      * 
      * @param m the method to create a type for
      * @param index The parameter index. If the index is less than zero, the
      *            return type is used.
      */
-    public Type createType(Method m, int index) {
+    public AegisType createType(Method m, int index) {
         TypeClassInfo info = createClassInfo(m, index);
         info.setDescription((index == -1 ? "return type" : "parameter " + index) + " of method "
                             + m.getName() + " in " + m.getDeclaringClass());
@@ -379,7 +379,7 @@
      * 
      * @param pd the propertydescriptor
      */
-    public Type createType(PropertyDescriptor pd) {
+    public AegisType createType(PropertyDescriptor pd) {
         TypeClassInfo info = createClassInfo(pd);
         info.setDescription("property " + pd.getName());
         return createTypeForClass(info);
@@ -390,7 +390,7 @@
      * 
      * @param f the field to create a type from
      */
-    public Type createType(Field f) {
+    public AegisType createType(Field f) {
         TypeClassInfo info = createClassInfo(f);
         info.setDescription("field " + f.getName() + " in " + f.getDeclaringClass());
         return createTypeForClass(info);
@@ -403,7 +403,7 @@
      * @param t the reflected type.
      * @return the type
      */
-    public Type createType(java.lang.reflect.Type t) {
+    public AegisType createType(java.lang.reflect.Type t) {
         TypeClassInfo info = new TypeClassInfo();
         info.setGenericType(t);
         if (t instanceof ParameterizedType) {
@@ -421,7 +421,7 @@
         
     }
 
-    public Type createType(Class clazz) {
+    public AegisType createType(Class clazz) {
         TypeClassInfo info = createBasicClassInfo(clazz);
         info.setDescription(clazz.toString());
         return createTypeForClass(info);

Copied: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java (from r809738, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java?p2=cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java&p1=cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java&r1=809738&r2=809790&rev=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java Tue Sep  1 01:13:06 2009
@@ -30,11 +30,11 @@
 import org.apache.ws.commons.schema.XmlSchemaElement;
 
 /**
- * A Type reads and writes XML fragments to create and write objects.
+ * Aegis abstraction for a object. Types are responsible for reading and writing the contents 
+ * of objects, but not, almost always, their own outermost XML element.
  * 
- * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
-public abstract class Type {
+public abstract class AegisType {
 
     protected Class typeClass;
     private QName schemaType;
@@ -44,7 +44,7 @@
     private boolean writeOuter = true;
     private boolean flatArray;
 
-    public Type() {
+    public AegisType() {
     }
 
     /**
@@ -140,12 +140,12 @@
     }
 
     /**
-     * Return a set of Type dependencies. Returns null if this type has no
+     * Return a set of AegisType dependencies. Returns null if this type has no
      * dependencies.
      * 
-     * @return Set of <code>Type</code> dependencies
+     * @return Set of <code>AegisType</code> dependencies
      */
-    public Set<Type> getDependencies() {
+    public Set<AegisType> getDependencies() {
         return null;
     }
 
@@ -158,8 +158,8 @@
             return true;
         }
 
-        if (obj instanceof Type) {
-            Type type = (Type)obj;
+        if (obj instanceof AegisType) {
+            AegisType type = (AegisType)obj;
 
             if (type.getSchemaType().equals(getSchemaType()) && type.getTypeClass().equals(getTypeClass())) {
                 return true;

Propchange: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AegisType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java Tue Sep  1 01:13:06 2009
@@ -53,7 +53,7 @@
     }
 
     @Override
-    public Type createCollectionType(TypeClassInfo info) {
+    public AegisType createCollectionType(TypeClassInfo info) {
         if (info.getGenericType() == null) {
             throw new DatabindingException("Cannot create mapping for " + info.getTypeClass().getName()
                                            + ", unspecified component type for " + info.getDescription());
@@ -63,7 +63,7 @@
     }
 
     @Override
-    public Type createDefaultType(TypeClassInfo info) {
+    public AegisType createDefaultType(TypeClassInfo info) {
         BeanType type = new BeanType();
         type.setSchemaType(createQName(info.getTypeClass()));
         type.setTypeClass(info.getTypeClass());
@@ -76,11 +76,11 @@
 
         return type;
     }
-    protected Type getOrCreateMapKeyType(TypeClassInfo info) {
+    protected AegisType getOrCreateMapKeyType(TypeClassInfo info) {
         return createObjectType();
     }
 
-    protected Type getOrCreateMapValueType(TypeClassInfo info) {
+    protected AegisType getOrCreateMapValueType(TypeClassInfo info) {
         return createObjectType();
     }
 }

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=809790&r1=809789&r2=809790&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 Tue Sep  1 01:13:06 2009
@@ -78,8 +78,8 @@
 public class DefaultTypeMapping implements TypeMapping {
     public  static final String DEFAULT_MAPPING_URI = "urn:org.apache.cxf.aegis.types";
     private static final Logger LOG = LogUtils.getL7dLogger(DefaultTypeMapping.class);
-    private Map<Class, Type> class2Type;
-    private Map<QName, Type> xml2Type;
+    private Map<Class, AegisType> class2Type;
+    private Map<QName, AegisType> xml2Type;
     private Map<Class, QName> class2xml;
     private TypeMapping nextTM;
     private TypeCreator typeCreator;
@@ -97,9 +97,9 @@
 
     public DefaultTypeMapping(String identifierURI) {
         this.identifierURI = identifierURI;
-        class2Type = Collections.synchronizedMap(new HashMap<Class, Type>());
+        class2Type = Collections.synchronizedMap(new HashMap<Class, AegisType>());
         class2xml = Collections.synchronizedMap(new HashMap<Class, QName>());
-        xml2Type = Collections.synchronizedMap(new HashMap<QName, Type>());
+        xml2Type = Collections.synchronizedMap(new HashMap<QName, AegisType>());
     }
 
     public boolean isRegistered(Class javaType) {
@@ -122,7 +122,7 @@
         return registered;
     }
 
-    public void register(Class javaType, QName xmlType, Type type) {
+    public void register(Class javaType, QName xmlType, AegisType type) {
         type.setSchemaType(xmlType);
         type.setTypeClass(javaType);
 
@@ -132,7 +132,7 @@
     /**
      * {@inheritDoc}
      */
-    public void register(Type type) {
+    public void register(AegisType type) {
         type.setTypeMapping(this);
         /*
          * -- prb@codehaus.org; changing this to only register the type for
@@ -152,7 +152,7 @@
         }
     }
 
-    public void removeType(Type type) {
+    public void removeType(AegisType type) {
         if (!xml2Type.containsKey(type.getSchemaType())) {
             nextTM.removeType(type);
         } else {
@@ -165,8 +165,8 @@
     /**
      * @see org.apache.cxf.aegis.type.TypeMapping#getType(java.lang.Class)
      */
-    public Type getType(Class javaType) {
-        Type type = class2Type.get(javaType);
+    public AegisType getType(Class javaType) {
+        AegisType type = class2Type.get(javaType);
 
         if (type == null && nextTM != null) {
             type = nextTM.getType(javaType);
@@ -178,8 +178,8 @@
     /**
      * @see org.apache.cxf.aegis.type.TypeMapping#getType(javax.xml.namespace.QName)
      */
-    public Type getType(QName xmlType) {
-        Type type = xml2Type.get(xmlType);
+    public AegisType getType(QName xmlType) {
+        AegisType type = xml2Type.get(xmlType);
 
         if (type == null && nextTM != null) {
             type = nextTM.getType(xmlType);
@@ -216,7 +216,7 @@
     }
 
     private static void defaultRegister(TypeMapping tm, boolean defaultNillable, Class class1, QName name,
-                                        Type type) {
+                                        AegisType type) {
         if (!defaultNillable) {
             type.setNillable(false);
         }
@@ -322,7 +322,7 @@
      */
     public static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable, 
                                                              boolean enableMtomXmime, boolean enableJDOM) {
-        // Create a Type Mapping for SOAP 1.1 Encoding
+        // Create a AegisType Mapping for SOAP 1.1 Encoding
         DefaultTypeMapping soapTM = new DefaultTypeMapping(Soap11.SOAP_ENCODING_URI);
         fillStandardMappings(soapTM, defaultNillable, enableMtomXmime, enableJDOM);
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java Tue Sep  1 01:13:06 2009
@@ -38,15 +38,15 @@
      */
     QName getElementName(Method m, int index);
 
-    Type createType(Method m, int index);
+    AegisType createType(Method m, int index);
 
-    Type createType(PropertyDescriptor pd);
+    AegisType createType(PropertyDescriptor pd);
     
-    Type createType(java.lang.reflect.Type type);
+    AegisType createType(java.lang.reflect.Type type);
 
-    Type createType(Field f);
+    AegisType createType(Field f);
 
-    Type createType(Class clazz);
+    AegisType createType(Class clazz);
 
     TypeCreator getParent();
     
@@ -72,5 +72,5 @@
      * @param info
      * @return
      */
-    Type createTypeForClass(TypeClassInfo info);
+    AegisType createTypeForClass(TypeClassInfo info);
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java Tue Sep  1 01:13:06 2009
@@ -48,19 +48,19 @@
      * @param xmlType XML Schema type QName.
      * @param type Aegis type object.
      */
-    void register(Class javaType, QName xmlType, Type type);
+    void register(Class javaType, QName xmlType, AegisType type);
 
     /**
      * Register a type that self-describes the schema type and the Java class.
      * @param type Aegis type object that 
      */
-    void register(Type type);
+    void register(AegisType type);
 
-    void removeType(Type type);
+    void removeType(AegisType type);
 
-    Type getType(Class javaType);
+    AegisType getType(Class javaType);
 
-    Type getType(QName xmlType);
+    AegisType getType(QName xmlType);
 
     QName getTypeQName(Class clazz);
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeUtil.java Tue Sep  1 01:13:06 2009
@@ -42,7 +42,7 @@
         //utility class
     }
     
-    public static Type getReadType(XMLStreamReader xsr, AegisContext context, Type baseType) {
+    public static AegisType getReadType(XMLStreamReader xsr, AegisContext context, AegisType baseType) {
 
         if (!context.isReadXsiTypes()) {
             if (baseType == null) {
@@ -57,7 +57,7 @@
             QName overrideName = NamespaceHelper.createQName(xsr.getNamespaceContext(), overrideType);
 
             if (baseType == null || !overrideName.equals(baseType.getSchemaType())) {
-                Type improvedType = null;
+                AegisType improvedType = null;
                 TypeMapping tm;
                 if (baseType != null) {
                     tm = baseType.getTypeMapping();
@@ -73,12 +73,12 @@
         
             if (baseType != null) {
                 LOG.finest("xsi:type=\"" + overrideName
-                         + "\" was specified, but no corresponding Type was registered; defaulting to "
+                         + "\" was specified, but no corresponding AegisType was registered; defaulting to "
                          + baseType.getSchemaType());
                 return baseType;
             } else {
                 LOG.warning("xsi:type=\"" + overrideName
-                         + "\" was specified, but no corresponding Type was registered; no default.");
+                         + "\" was specified, but no corresponding AegisType was registered; no default.");
                 return null;
             }
         } else {
@@ -98,7 +98,8 @@
      * @param context
      * @return
      */
-    public static Type getReadTypeStandalone(XMLStreamReader xsr, AegisContext context, Type baseType) {
+    public static AegisType getReadTypeStandalone(XMLStreamReader xsr, 
+                                                  AegisContext context, AegisType baseType) {
         
         if (baseType != null) {
             return getReadType(xsr, context, baseType);
@@ -116,7 +117,7 @@
                                                                typeNameString);
             TypeMapping tm;
             tm = context.getTypeMapping();
-            Type type = tm.getType(schemaTypeName);
+            AegisType type = tm.getType(schemaTypeName);
             
             if (type == null) {
                 type = context.getRootType(schemaTypeName);
@@ -127,16 +128,16 @@
             }
                     
             LOG.warning("xsi:type=\"" + schemaTypeName
-                     + "\" was specified, but no corresponding Type was registered; no default.");
+                     + "\" was specified, but no corresponding AegisType was registered; no default.");
             return null;
         }
         LOG.warning("xsi:type was not specified for top-level element " + xsr.getName());
         return null;
     }
     
-    public static Type getWriteType(AegisContext globalContext, Object value, Type type) {
+    public static AegisType getWriteType(AegisContext globalContext, Object value, AegisType type) {
         if (value != null && type != null && type.getTypeClass() != value.getClass()) {
-            Type overrideType = globalContext.getRootType(value.getClass());
+            AegisType overrideType = globalContext.getRootType(value.getClass());
             if (overrideType != null) {
                 return overrideType;
             }
@@ -144,7 +145,7 @@
         return type;
     }
 
-    public static Type getWriteTypeStandalone(AegisContext globalContext, Object value, Type type) {
+    public static AegisType getWriteTypeStandalone(AegisContext globalContext, Object value, AegisType type) {
         if (type != null) {
             return getWriteType(globalContext, value, type);
         }
@@ -165,11 +166,11 @@
      * @param reflectType the type to use in writing the object.
      * @return
      */
-    public static Type getWriteTypeStandalone(AegisContext globalContext, 
+    public static AegisType getWriteTypeStandalone(AegisContext globalContext, 
                                               Object value, 
                                               java.lang.reflect.Type reflectType) {
         if (reflectType == null) {
-            return getWriteTypeStandalone(globalContext, value, (Type)null);
+            return getWriteTypeStandalone(globalContext, value, (AegisType)null);
         } else {
             return globalContext.getTypeMapping().getTypeCreator().createType(reflectType);
         }
@@ -178,7 +179,7 @@
     }
     
     
-    public static void setAttributeAttributes(QName name, Type type, XmlSchema root) {
+    public static void setAttributeAttributes(QName name, AegisType type, XmlSchema root) {
         String ns = type.getSchemaType().getNamespaceURI();
         XmlSchemaUtils.addImportIfNeeded(root, ns);
     }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java Tue Sep  1 01:13:06 2009
@@ -228,7 +228,7 @@
     }
 
     @Override
-    public Type createEnumType(TypeClassInfo info) {
+    public AegisType createEnumType(TypeClassInfo info) {
         Element mapping = findMapping(info.getTypeClass());
         if (mapping != null) {
             return super.createEnumType(info);
@@ -238,7 +238,7 @@
     }
 
     @Override
-    public Type createCollectionType(TypeClassInfo info) {
+    public AegisType createCollectionType(TypeClassInfo info) {
         if (info.getGenericType() instanceof Class || info.getGenericType() instanceof TypeClassInfo) {
             return createCollectionTypeFromGeneric(info);
         }
@@ -319,7 +319,7 @@
     }
 
     @Override
-    public Type createDefaultType(TypeClassInfo info) {
+    public AegisType createDefaultType(TypeClassInfo info) {
         Element mapping = findMapping(info.getTypeClass());
         List mappings = findMappings(info.getTypeClass());
 
@@ -479,8 +479,8 @@
     }
 
     @Override
-    protected Type getOrCreateGenericType(TypeClassInfo info) {
-        Type type = null;
+    protected AegisType getOrCreateGenericType(TypeClassInfo info) {
+        AegisType type = null;
         if (info.getGenericType() != null) {
             type = createTypeFromGeneric(info.getGenericType());
         }
@@ -492,7 +492,7 @@
         return type;
     }
 
-    private Type createTypeFromGeneric(Object cType) {
+    private AegisType createTypeFromGeneric(Object cType) {
         if (cType instanceof TypeClassInfo) {
             return createTypeForClass((TypeClassInfo)cType);
         } else if (cType instanceof Class) {
@@ -503,8 +503,8 @@
     }
 
     @Override
-    protected Type getOrCreateMapKeyType(TypeClassInfo info) {
-        Type type = null;
+    protected AegisType getOrCreateMapKeyType(TypeClassInfo info) {
+        AegisType type = null;
         if (info.getKeyType() != null) {
             type = createTypeFromGeneric(info.getKeyType());
         }
@@ -517,8 +517,8 @@
     }
 
     @Override
-    protected Type getOrCreateMapValueType(TypeClassInfo info) {
-        Type type = null;
+    protected AegisType getOrCreateMapValueType(TypeClassInfo info) {
+        AegisType type = null;
         if (info.getGenericType() != null) {
             type = createTypeFromGeneric(info.getValueType());
         }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ArrayType.java Tue Sep  1 01:13:06 2009
@@ -30,7 +30,7 @@
 
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
@@ -47,7 +47,7 @@
  * 
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
-public class ArrayType extends Type {
+public class ArrayType extends AegisType {
     private static final Logger LOG = LogUtils.getL7dLogger(ArrayType.class);
 
     private QName componentName;
@@ -101,7 +101,7 @@
             // the reader does some really confusing things.
             XMLStreamReader xmlReader = reader.getXMLStreamReader();
             while (xmlReader.getName().equals(flatElementName)) {
-                Type compType = TypeUtil.getReadType(reader.getXMLStreamReader(),
+                AegisType compType = TypeUtil.getReadType(reader.getXMLStreamReader(),
                                                      context.getGlobalContext(), getComponentType());
                 // gosh, what about message readers of some other type?
                 ElementReader thisItemReader = new ElementReader(xmlReader);
@@ -110,7 +110,7 @@
         } else {
             while (reader.hasMoreElementReaders()) {
                 MessageReader creader = reader.getNextElementReader();
-                Type compType = TypeUtil.getReadType(creader.getXMLStreamReader(),
+                AegisType compType = TypeUtil.getReadType(creader.getXMLStreamReader(),
                                                      context.getGlobalContext(), getComponentType());
                 collectOneItem(context, values, creader, compType);
             }
@@ -125,7 +125,7 @@
     }
 
     private void collectOneItem(Context context, Collection<Object> values, MessageReader creader,
-                                Type compType) {
+                                AegisType compType) {
         if (creader.isXsiNil()) {
             values.add(null);
             creader.readToEnd();
@@ -223,7 +223,7 @@
             return;
         }
 
-        Type type = getComponentType();
+        AegisType type = getComponentType();
         if (type == null) {
             throw new DatabindingException("Couldn't find type for array.");
         }
@@ -313,7 +313,8 @@
         }
     }
 
-    protected void writeValue(Object value, MessageWriter writer, Context context, Type type, String name,
+    protected void writeValue(Object value, MessageWriter writer, Context context, 
+                              AegisType type, String name,
                               String ns) throws DatabindingException {
         type = TypeUtil.getWriteType(context.getGlobalContext(), value, type);
         MessageWriter cwriter;
@@ -352,7 +353,7 @@
         XmlSchemaSequence seq = new XmlSchemaSequence();
         complex.setParticle(seq);
 
-        Type componentType = getComponentType();
+        AegisType componentType = getComponentType();
         XmlSchemaElement element = new XmlSchemaElement();
         element.setName(componentType.getSchemaType().getLocalPart());
         element.setSchemaTypeName(componentType.getSchemaType());
@@ -382,7 +383,7 @@
     /**
      * We need to write a complex type schema for Beans, so return true.
      * 
-     * @see org.apache.cxf.aegis.type.Type#isComplex()
+     * @see org.apache.cxf.aegis.type.AegisType#isComplex()
      */
     @Override
     public boolean isComplex() {
@@ -398,11 +399,11 @@
     }
 
     /**
-     * @see org.apache.cxf.aegis.type.Type#getDependencies()
+     * @see org.apache.cxf.aegis.type.AegisType#getDependencies()
      */
     @Override
-    public Set<Type> getDependencies() {
-        Set<Type> deps = new HashSet<Type>();
+    public Set<AegisType> getDependencies() {
+        Set<AegisType> deps = new HashSet<AegisType>();
 
         deps.add(getComponentType());
 
@@ -410,14 +411,14 @@
     }
 
     /**
-     * Get the <code>Type</code> of the elements in the array.
+     * Get the <code>AegisType</code> of the elements in the array.
      * 
      * @return
      */
-    public Type getComponentType() {
+    public AegisType getComponentType() {
         Class compType = getTypeClass().getComponentType();
 
-        Type type;
+        AegisType type;
 
         if (componentName == null) {
             type = getTypeMapping().getType(compType);

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/Base64Type.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/Base64Type.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/Base64Type.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/Base64Type.java Tue Sep  1 01:13:06 2009
@@ -27,7 +27,7 @@
 
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.mtom.AbstractXOPType;
 import org.apache.cxf.aegis.type.mtom.ByteArrayType;
 import org.apache.cxf.aegis.xml.MessageReader;
@@ -41,7 +41,7 @@
  * inline base64 or an MTOM attachment. It passes the problem over the ByteArrayType for the later. 
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  */
-public class Base64Type extends Type {
+public class Base64Type extends AegisType {
     private AbstractXOPType optimizedType;
 
     public Base64Type() {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java Tue Sep  1 01:13:06 2009
@@ -34,7 +34,7 @@
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
 import org.apache.cxf.aegis.type.AbstractTypeCreator;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.TypeUtil;
 import org.apache.cxf.aegis.type.mtom.AbstractXOPType;
@@ -63,7 +63,7 @@
  * each piece of code that uses the type info needs to call getTypeInfo() instead of referencing the
  * 'info' field. 
  */
-public class BeanType extends Type {
+public class BeanType extends AegisType {
     private BeanTypeInfo info;
 
     private boolean isInterface;
@@ -137,7 +137,7 @@
                 MessageReader childReader = reader.getNextAttributeReader();
                 QName name = childReader.getName();
 
-                Type type = inf.getType(name);
+                AegisType type = inf.getType(name);
 
                 if (type != null) {
                     Object writeObj = type.readObject(childReader, context);
@@ -153,8 +153,8 @@
                 // Find the BeanTypeInfo that contains a property for the element name
                 BeanTypeInfo propertyTypeInfo = getBeanTypeInfoWithProperty(name);
 
-                // Get the Type for the property
-                Type type = getElementType(name, propertyTypeInfo, childReader, context);
+                // Get the AegisType for the property
+                AegisType type = getElementType(name, propertyTypeInfo, childReader, context);
 
                 if (type != null) {
                     if (!childReader.isXsiNil()) {
@@ -194,12 +194,12 @@
         }
     }
 
-    protected Type getElementType(QName name, BeanTypeInfo beanTypeInfo, 
+    protected AegisType getElementType(QName name, BeanTypeInfo beanTypeInfo, 
                                   MessageReader reader, Context context) {
 
-        Type type = beanTypeInfo.getType(name);
+        AegisType type = beanTypeInfo.getType(name);
 
-        // Type can be overriden with a xsi:type attribute
+        // AegisType can be overriden with a xsi:type attribute
         type = TypeUtil.getReadType(reader.getXMLStreamReader(), context.getGlobalContext(), type);
         return type;
     }
@@ -342,7 +342,7 @@
 
             Object value = readProperty(object, name);
             if (value != null) {
-                Type type = getType(inf, name);
+                AegisType type = getType(inf, name);
 
                 if (type == null) {
                     throw new DatabindingException("Couldn't find type for " + value.getClass()
@@ -358,7 +358,7 @@
         }
         
         if (inf.isExtension()) {
-            Type t = getSuperType();
+            AegisType t = getSuperType();
             if (t != null) {
                 t.writeObject(object, writer, context);
             }
@@ -373,8 +373,8 @@
             }
             Object value = readProperty(object, name);
 
-            Type defaultType = getType(inf, name);
-            Type type = TypeUtil.getWriteType(context.getGlobalContext(), value, defaultType);
+            AegisType defaultType = getType(inf, name);
+            AegisType type = TypeUtil.getWriteType(context.getGlobalContext(), value, defaultType);
 
             // Write the value if it is not null.
             if (value != null) {
@@ -396,7 +396,8 @@
        
     }
 
-    protected void writeElement(QName name, Object value, Type type, MessageWriter writer, Context context) {
+    protected void writeElement(QName name, Object value, 
+                                AegisType type, MessageWriter writer, Context context) {
 
         if (!type.isFlatArray()) {
             MessageWriter cwriter = null;
@@ -409,7 +410,7 @@
         }
     }
 
-    private MessageWriter getWriter(MessageWriter writer, QName name, Type type) {
+    private MessageWriter getWriter(MessageWriter writer, QName name, AegisType type) {
         MessageWriter cwriter;
         cwriter = writer.getElementWriter(name);
         return cwriter;
@@ -432,8 +433,8 @@
         }
     }
 
-    private Type getType(BeanTypeInfo inf, QName name) {
-        Type type = inf.getType(name);
+    private AegisType getType(BeanTypeInfo inf, QName name) {
+        AegisType type = inf.getType(name);
 
         if (type == null) {
             throw new NullPointerException("Couldn't find type for" + name + " in class "
@@ -443,7 +444,7 @@
         return type;
     }
 
-    private void writeTypeReference(QName name, XmlSchemaElement element, Type type, 
+    private void writeTypeReference(QName name, XmlSchemaElement element, AegisType type, 
                                     XmlSchema schemaRoot) {
         if (type.isAbstract()) {
             element.setName(name.getLocalPart());
@@ -486,7 +487,7 @@
     /**
      * We need to write a complex type schema for Beans, so return true.
      * 
-     * @see org.apache.cxf.aegis.type.Type#isComplex()
+     * @see org.apache.cxf.aegis.type.AegisType#isComplex()
      */
     @Override
     public boolean isComplex() {
@@ -497,8 +498,8 @@
      * {@inheritDoc}
      */
     @Override
-    public Set<Type> getDependencies() {
-        Set<Type> deps = new HashSet<Type>();
+    public Set<AegisType> getDependencies() {
+        Set<AegisType> deps = new HashSet<AegisType>();
 
         BeanTypeInfo inf = getTypeInfo();
 
@@ -519,7 +520,7 @@
          * Automagically add chain of superclasses if this is an an extension.
          */
         if (inf.isExtension()) {
-            Type sooperType = getSuperType();
+            AegisType sooperType = getSuperType();
             if (sooperType != null) {
                 deps.add(sooperType);
             }
@@ -531,12 +532,12 @@
     protected BeanTypeInfo getBeanTypeInfoWithProperty(QName name) {
         // search the BeanType superType tree for the first BeanType with a property named 'name'
         BeanType beanType = this;
-        Type type = null;
+        AegisType type = null;
         while (type == null && beanType != null) {
             type = beanType.getTypeInfo().getType(name);
 
             if (type == null) {
-                Type superType = beanType.getSuperType(); /*
+                AegisType superType = beanType.getSuperType(); /*
                                                            * The class might inherit from, say, 'Integer'. In
                                                            * which case we've got no BeanType to work with.
                                                            */
@@ -559,10 +560,10 @@
     }
 
     /**
-     * Return the Type for the superclass if this type's class, if any.
+     * Return the AegisType for the superclass if this type's class, if any.
      * @return
      */
-    public Type getSuperType() {
+    public AegisType getSuperType() {
         BeanTypeInfo inf = getTypeInfo();
         Class c = inf.getTypeClass().getSuperclass();
         /*
@@ -570,7 +571,7 @@
          */
         if (c != null && c != Object.class && c != Exception.class && c != RuntimeException.class) {
             TypeMapping tm = inf.getTypeMapping();
-            Type superType = tm.getType(c);
+            AegisType superType = tm.getType(c);
             if (superType == null) {
                 // if we call createType, we know that we'll get a BeanType. */
                 superType = (BeanType)getTypeMapping().getTypeCreator().createType(c);
@@ -665,7 +666,7 @@
         root.addType(complex);
         root.getItems().add(complex);
 
-        Type sooperType = getSuperType();
+        AegisType sooperType = getSuperType();
 
         /*
          * See Java Virtual Machine specification:
@@ -715,7 +716,7 @@
             element.setName(name.getLocalPart());
             sequence.getItems().add(element);
 
-            Type type = getType(inf, name);
+            AegisType type = getType(inf, name);
             if (type.isFlatArray()) {
                 // ok, we need some tricks here
                 element.setMinOccurs(type.getMinOccurs());
@@ -759,7 +760,7 @@
             XmlSchemaAttribute attribute = new XmlSchemaAttribute();
             complex.getAttributes().add(attribute);
             attribute.setName(name.getLocalPart());
-            Type type = getType(inf, name);
+            AegisType type = getType(inf, name);
             attribute.setSchemaTypeName(type.getSchemaType());
             String ns = name.getNamespaceURI();
             if (!ns.equals(root.getTargetNamespace())) {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanTypeInfo.java Tue Sep  1 01:13:06 2009
@@ -33,14 +33,14 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.type.TypeCreator;
 import org.apache.cxf.aegis.type.TypeMapping;
 
 public class BeanTypeInfo {
     private Map<QName, QName> mappedName2typeName = new HashMap<QName, QName>();
     private Map<QName, String> mappedName2pdName = new HashMap<QName, String>();
-    private Map<QName, Type> mappedName2type = new HashMap<QName, Type>();
+    private Map<QName, AegisType> mappedName2type = new HashMap<QName, AegisType>();
     private Class<?> beanClass;
     private List<QName> attributes = new ArrayList<QName>();
     private List<QName> elements = new ArrayList<QName>();
@@ -55,12 +55,12 @@
     private boolean qualifyElements = true;
 
     /**
-     * extensibleElements means adding xs:any to WSDL Complex Type Definition
+     * extensibleElements means adding xs:any to WSDL Complex AegisType Definition
      */
     private boolean extensibleElements = true;
 
     /**
-     * extensibleAttributes means adding xs:anyAttribute to WSDL Complex Type
+     * extensibleAttributes means adding xs:anyAttribute to WSDL Complex AegisType
      * Definition
      */
     private boolean extensibleAttributes = true;
@@ -151,9 +151,9 @@
     /**
      * Get the type class for the field with the specified QName.
      */
-    public Type getType(QName name) {
+    public AegisType getType(QName name) {
         // 1. Try a prexisting mapped type
-        Type type = mappedName2type.get(name);
+        AegisType type = mappedName2type.get(name);
 
         // 2. Try to get the type by its name, if there is one
         if (type == null) {
@@ -212,7 +212,7 @@
         return true;
     }
 
-    public void mapType(QName name, Type type) {
+    public void mapType(QName name, AegisType type) {
         mappedName2type.put(name, type);
     }
 
@@ -372,7 +372,7 @@
      * @return
      */
     public boolean isNillable(QName name) {
-        Type type = getType(name);
+        AegisType type = getType(name);
         if (!type.isNillable()) {
             return false;
         }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java?rev=809790&r1=809789&r2=809790&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java Tue Sep  1 01:13:06 2009
@@ -21,16 +21,16 @@
 import java.math.BigDecimal;
 
 import org.apache.cxf.aegis.Context;
-import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.type.AegisType;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
 
 /**
- * <code>Type</code> for a <code>BigDecimal</code>
+ * <code>AegisType</code> for a <code>BigDecimal</code>
  * 
  * @author <a href="mailto:peter.royal@pobox.com">peter royal</a>
  */
-public class BigDecimalType extends Type {
+public class BigDecimalType extends AegisType {
     public BigDecimalType() {
         super();
     }



Mime
View raw message