Package org.apache.cxf.aegis.type.basic
Class ArrayType
- java.lang.Object
-
- org.apache.cxf.aegis.type.AegisType
-
- org.apache.cxf.aegis.type.basic.ArrayType
-
- Direct Known Subclasses:
CollectionType
public class ArrayType extends AegisType
An ArrayType.
-
-
Constructor Summary
Constructors Constructor Description ArrayType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<Object>createCollection()QNamegetComponentName()AegisTypegetComponentType()Get theAegisTypeof the elements in the array.Set<AegisType>getDependencies()Return a set of AegisType dependencies.longgetMaxOccurs()longgetMinOccurs()booleanhasMaxOccurs()booleanhasMinOccurs()booleanisComplex()We need to write a complex type schema for Beans, so return true.booleanisFlat()protected ObjectmakeArray(Class<?> arrayType, Collection<Object> values)protected Collection<Object>readCollection(MessageReader reader, QName flatElementName, Context context)Read the elements of an array or array-like item.ObjectreadObject(MessageReader reader, QName flatElementName, Context context, boolean asArray)ObjectreadObject(MessageReader reader, Context context)Read in the XML fragment and create an object.voidsetComponentName(QName componentName)voidsetFlat(boolean flat)voidsetMaxOccurs(long maxOccurs)voidsetMinOccurs(long minOccurs)voidwriteObject(Object values, MessageWriter writer, Context context)Writes the object to the MessageWriter.voidwriteObject(Object values, MessageWriter writer, Context context, QName flatElementName)Write an array type, using the desired element name in the flattened case.voidwriteSchema(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 voidwriteValue(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
-
-
-
-
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:AegisTypeRead in the XML fragment and create an object.- Specified by:
readObjectin classAegisType- Returns:
- Throws:
DatabindingException
-
createCollection
protected Collection<Object> createCollection()
-
readCollection
protected Collection<Object> 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<Object> values)
-
writeObject
public void writeObject(Object values, MessageWriter writer, Context context) throws DatabindingException
Description copied from class:AegisTypeWrites the object to the MessageWriter.- Specified by:
writeObjectin classAegisType- 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:AegisTypeIf this type should correspond to a global, named, schema type, here is where the type object adds it to the schema.- Overrides:
writeSchemain classAegisType- 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:
isComplexin classAegisType- 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:AegisTypeReturn a set of AegisType dependencies. Returns null if this type has no dependencies.- Overrides:
getDependenciesin classAegisType- Returns:
- Set of
AegisTypedependencies - See Also:
AegisType.getDependencies()
-
getComponentType
public AegisType getComponentType()
Get theAegisTypeof the elements in the array.- Returns:
-
getMaxOccurs
public long getMaxOccurs()
- Overrides:
getMaxOccursin classAegisType
-
setMaxOccurs
public void setMaxOccurs(long maxOccurs)
-
getMinOccurs
public long getMinOccurs()
- Overrides:
getMinOccursin classAegisType
-
setMinOccurs
public void setMinOccurs(long minOccurs)
-
isFlat
public boolean isFlat()
-
setFlat
public void setFlat(boolean flat)
-
hasMaxOccurs
public boolean hasMaxOccurs()
- Overrides:
hasMaxOccursin classAegisType
-
hasMinOccurs
public boolean hasMinOccurs()
- Overrides:
hasMinOccursin classAegisType
-
-