Apache CXF API

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

java.lang.Object
  extended by org.apache.cxf.aegis.type.AegisType
      extended by org.apache.cxf.aegis.type.basic.ArrayType
Direct Known Subclasses:
CollectionType

public class ArrayType
extends AegisType

An ArrayType.

Author:
Dan Diephouse

Field Summary
 
Fields inherited from class org.apache.cxf.aegis.type.AegisType
typeClass
 
Constructor Summary
ArrayType()
           
 
Method Summary
protected  Collection<Object> createCollection()
           
 QName getComponentName()
           
 AegisType getComponentType()
          Get the AegisType of the elements in the array.
 Set<AegisType> getDependencies()
          Return a set of AegisType dependencies.
 long getMaxOccurs()
           
 long getMinOccurs()
           
 boolean hasMaxOccurs()
           
 boolean hasMinOccurs()
           
 boolean isComplex()
          We need to write a complex type schema for Beans, so return true.
 boolean isFlat()
           
protected  Object makeArray(Class arrayType, Collection values)
           
protected  Collection readCollection(MessageReader reader, QName flatElementName, Context context)
          Read the elements of an array or array-like item.
 Object readObject(MessageReader reader, Context context)
          Read in the XML fragment and create an object.
 Object readObject(MessageReader reader, QName flatElementName, Context context, boolean asArray)
           
 void setComponentName(QName componentName)
           
 void setFlat(boolean flat)
           
 void setMaxOccurs(long maxOccurs)
           
 void setMinOccurs(long minOccurs)
           
 void writeObject(Object values, MessageWriter writer, Context context)
          Writes the object to the MessageWriter.
 void writeObject(Object values, MessageWriter writer, Context context, QName flatElementName)
          Write an array type, using the desired element name in the flattened case.
 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.
protected  void writeValue(Object value, MessageWriter writer, Context context, AegisType type, String name, String ns)
           
 
Methods inherited from class org.apache.cxf.aegis.type.AegisType
addToSchemaElement, equals, getSchemaType, getType, getTypeClass, getTypeMapping, hashCode, 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

ArrayType

public ArrayType()
Method Detail

readObject

public Object readObject(MessageReader reader,
                         QName flatElementName,
                         Context context,
                         boolean asArray)
                  throws DatabindingException
Throws:
DatabindingException

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

createCollection

protected Collection<Object> createCollection()

readCollection

protected Collection readCollection(MessageReader reader,
                                    QName flatElementName,
                                    Context context)
                             throws DatabindingException
Read the elements of an array or array-like item.

Parameters:
reader - reader to read from.
flatElementName - if flat, the elements we are looking for. When we see something else. we stop.
context - context.
Returns:
a collection of the objects.
Throws:
DatabindingException

makeArray

protected Object makeArray(Class arrayType,
                           Collection values)

writeObject

public void writeObject(Object values,
                        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

writeObject

public void writeObject(Object values,
                        MessageWriter writer,
                        Context context,
                        QName flatElementName)
                 throws DatabindingException
Write an array type, using the desired element name in the flattened case.

Parameters:
values - values to write.
writer - writer to sent it to.
context - the aegis context.
flatElementName - name to use for the element if flat.
Throws:
DatabindingException

writeValue

protected void writeValue(Object value,
                          MessageWriter writer,
                          Context context,
                          AegisType type,
                          String name,
                          String ns)
                   throws DatabindingException
Throws:
DatabindingException

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.

isComplex

public boolean isComplex()
We need to write a complex type schema for Beans, so return true.

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

getComponentName

public QName getComponentName()

setComponentName

public void setComponentName(QName componentName)

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
See Also:
AegisType.getDependencies()

getComponentType

public AegisType getComponentType()
Get the AegisType of the elements in the array.

Returns:

getMaxOccurs

public long getMaxOccurs()
Overrides:
getMaxOccurs in class AegisType

setMaxOccurs

public void setMaxOccurs(long maxOccurs)

getMinOccurs

public long getMinOccurs()
Overrides:
getMinOccurs in class AegisType

setMinOccurs

public void setMinOccurs(long minOccurs)

isFlat

public boolean isFlat()

setFlat

public void setFlat(boolean flat)

hasMaxOccurs

public boolean hasMaxOccurs()
Overrides:
hasMaxOccurs in class AegisType

hasMinOccurs

public boolean hasMinOccurs()
Overrides:
hasMinOccurs in class AegisType

Apache CXF API

Apache CXF