org.codehaus.xfire.aegis.type.basic
Class ObjectType

java.lang.Object
  extended by org.codehaus.xfire.aegis.type.Type
      extended by org.codehaus.xfire.aegis.type.basic.ObjectType
All Implemented Interfaces:
SchemaType

public class ObjectType
extends Type

Type 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 Type'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.

Author:
peter royal

Constructor Summary
ObjectType()
           
ObjectType(boolean serializeWhenUnknown)
           
ObjectType(java.util.Set dependencies)
           
ObjectType(java.util.Set dependencies, boolean serializeWhenUnknown)
           
 
Method Summary
 java.util.Set getDependencies()
          Return a set of Type dependencies.
 boolean isAbstract()
          Whether or not this a complexType or a concrete element.
 boolean isComplex()
          Whether or not this a complex type.
 boolean isNillable()
           
 boolean isReadToDocument()
           
 boolean isSerializedWhenUnknown()
           
 boolean isWriteOuter()
           
 java.lang.Object readObject(MessageReader reader, MessageContext context)
          Read in the XML fragment and create an object.
 void setDependencies(java.util.Set dependencies)
           
 void setNillable(boolean nillable)
           
 void setReadToDocument(boolean readToDocument)
           
 void setSerializedWhenUnknown(boolean serializedWhenUnknown)
           
 void writeObject(java.lang.Object object, MessageWriter writer, MessageContext context)
          Writes the object to the MessageWriter.
 void writeSchema(Element root)
          Write the type schema (if complex) to the element.
 
Methods inherited from class org.codehaus.xfire.aegis.type.Type
equals, getSchemaType, getTypeClass, getTypeMapping, hashCode, setAbstract, setSchemaType, setTypeClass, setTypeMapping, setWriteOuter, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectType

public ObjectType()

ObjectType

public ObjectType(java.util.Set dependencies)

ObjectType

public ObjectType(boolean serializeWhenUnknown)

ObjectType

public ObjectType(java.util.Set dependencies,
                  boolean serializeWhenUnknown)
Method Detail

readObject

public java.lang.Object readObject(MessageReader reader,
                                   MessageContext context)
                            throws XFireFault
Description copied from class: Type
Read in the XML fragment and create an object.

Specified by:
readObject in class Type
Returns:
Throws:
XFireFault

writeObject

public void writeObject(java.lang.Object object,
                        MessageWriter writer,
                        MessageContext context)
                 throws XFireFault
Description copied from class: Type
Writes the object to the MessageWriter.

Specified by:
writeObject in class Type
Throws:
XFireFault

isReadToDocument

public boolean isReadToDocument()

setReadToDocument

public void setReadToDocument(boolean readToDocument)

isSerializedWhenUnknown

public boolean isSerializedWhenUnknown()

setSerializedWhenUnknown

public void setSerializedWhenUnknown(boolean serializedWhenUnknown)

setDependencies

public void setDependencies(java.util.Set dependencies)

getDependencies

public java.util.Set getDependencies()
Description copied from class: Type
Return a set of Type dependencies. Returns null if this type has no dependencies.

Specified by:
getDependencies in interface SchemaType
Overrides:
getDependencies in class Type
Returns:
Set of Type dependencies

isComplex

public boolean isComplex()
Description copied from interface: SchemaType
Whether or not this a complex type. If true then the schema for this type is written out.

Specified by:
isComplex in interface SchemaType
Overrides:
isComplex in class Type
Returns:
True if a complex type schema must be written.

isAbstract

public boolean isAbstract()
Description copied from interface: SchemaType
Whether or not this a complexType or a concrete element.

Specified by:
isAbstract in interface SchemaType
Overrides:
isAbstract in class Type
Returns:

isNillable

public boolean isNillable()
Specified by:
isNillable in interface SchemaType
Overrides:
isNillable in class Type

isWriteOuter

public boolean isWriteOuter()
Specified by:
isWriteOuter in interface SchemaType
Overrides:
isWriteOuter in class Type

setNillable

public void setNillable(boolean nillable)
Overrides:
setNillable in class Type

writeSchema

public void writeSchema(Element root)
Description copied from interface: SchemaType
Write the type schema (if complex) to the element.

Specified by:
writeSchema in interface SchemaType
Overrides:
writeSchema in class Type


Copyright © 2004-2006 Envoi Solutions LLC. All Rights Reserved.