org.apache.cxf.aegis.type.basic
Class ObjectType

java.lang.Object
  extended by org.apache.cxf.aegis.type.AegisType
      extended by org.apache.cxf.aegis.type.basic.ObjectType

public class ObjectType
extends AegisType

AegisType for runtime inspection of types. Looks as the class to be written, and looks to see if there is a type for that class. If there is, it writes out the value and inserts a xsi:type attribute to signal what the type of the value is. Can specify an optional set of dependent AegisType's in the constructor, in the case that the type is a custom type that may not have its schema in the WSDL. Can specify whether or not unknown objects should be serialized as a byte stream.


Field Summary
 
Fields inherited from class org.apache.cxf.aegis.type.AegisType
typeClass
 
Constructor Summary
ObjectType()
           
ObjectType(boolean serializeWhenUnknown)
           
ObjectType(Set<AegisType> dependencies)
           
ObjectType(Set<AegisType> dependencies, boolean serializeWhenUnknown)
           
 
Method Summary
 AegisType determineType(Context context, Class clazz)
           
 Set<AegisType> getDependencies()
          Return a set of AegisType dependencies.
 boolean isComplex()
           
 boolean isReadToDocument()
           
 boolean isSerializedWhenUnknown()
           
 Object readObject(MessageReader reader, Context context)
          Read in the XML fragment and create an object.
 void setDependencies(Set<AegisType> dependencies)
           
 void setReadToDocument(boolean readToDocument)
           
 void setSerializedWhenUnknown(boolean serializedWhenUnknown)
           
 void writeObject(Object object, MessageWriter writer, Context context)
          Writes the object to the MessageWriter.
 void writeSchema(org.apache.ws.commons.schema.XmlSchema root)
          If this type should correspond to a global, named, schema type, here is where the type object adds it to the schema.
 
Methods inherited from class org.apache.cxf.aegis.type.AegisType
addToSchemaElement, equals, getMaxOccurs, getMinOccurs, getSchemaType, getType, getTypeClass, getTypeMapping, hashCode, hasMaxOccurs, hasMinOccurs, isAbstract, isFlatArray, isNillable, isWriteOuter, setAbstract, setFlatArray, setNillable, setSchemaType, setTypeClass, setTypeMapping, setWriteOuter, toString, usesUtilityTypes, usesXmime
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectType

public ObjectType()

ObjectType

public ObjectType(Set<AegisType> dependencies)

ObjectType

public ObjectType(boolean serializeWhenUnknown)

ObjectType

public ObjectType(Set<AegisType> dependencies,
                  boolean serializeWhenUnknown)
Method Detail

readObject

public Object readObject(MessageReader reader,
                         Context context)
                  throws DatabindingException
Description copied from class: AegisType
Read in the XML fragment and create an object.

Specified by:
readObject in class AegisType
Returns:
Throws:
DatabindingException

writeObject

public void writeObject(Object object,
                        MessageWriter writer,
                        Context context)
                 throws DatabindingException
Description copied from class: AegisType
Writes the object to the MessageWriter.

Specified by:
writeObject in class AegisType
Throws:
DatabindingException

determineType

public AegisType determineType(Context context,
                               Class clazz)

isReadToDocument

public boolean isReadToDocument()

setReadToDocument

public void setReadToDocument(boolean readToDocument)

isSerializedWhenUnknown

public boolean isSerializedWhenUnknown()

setSerializedWhenUnknown

public void setSerializedWhenUnknown(boolean serializedWhenUnknown)

setDependencies

public void setDependencies(Set<AegisType> dependencies)

getDependencies

public Set<AegisType> getDependencies()
Description copied from class: AegisType
Return a set of AegisType dependencies. Returns null if this type has no dependencies.

Overrides:
getDependencies in class AegisType
Returns:
Set of AegisType dependencies

isComplex

public boolean isComplex()
Overrides:
isComplex in class AegisType
Returns:
True if a complex type schema must be written.

writeSchema

public void writeSchema(org.apache.ws.commons.schema.XmlSchema root)
Description copied from class: AegisType
If this type should correspond to a global, named, schema type, here is where the type object adds it to the schema.

Overrides:
writeSchema in class AegisType
Parameters:
root - root of the XSD document.


Apache CXF