Package org.apache.cxf.aegis.type
Class AegisType
- java.lang.Object
-
- org.apache.cxf.aegis.type.AegisType
-
- Direct Known Subclasses:
AbstractXOPType,ArrayType,Base64Type,BeanType,BigDecimalType,BigIntegerType,BooleanType,ByteType,CalendarType,CharacterAsStringType,CharacterType,DateTimeType,DateType,DocumentType,DoubleType,DurationType,EnumType,FloatType,IntType,JDOMDocumentType,JDOMElementType,LongType,MapType,ObjectType,ShortType,SoapArrayType,SoapRefType,SourceType,StringType,TimestampType,TimeType,URIType,XMLGregorianCalendarType,XMLStreamReaderType
public abstract class AegisType extends Object
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.
-
-
Constructor Summary
Constructors Constructor Description AegisType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddToSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement schemaElement)If the type object merely wants to contribute attributes to the xsd:element element, it can implement this.booleanequals(Object obj)Set<AegisType>getDependencies()Return a set of AegisType dependencies.longgetMaxOccurs()longgetMinOccurs()QNamegetSchemaType()TypegetType()Class<?>getTypeClass()TypeMappinggetTypeMapping()inthashCode()booleanhasMaxOccurs()booleanhasMinOccurs()booleanisAbstract()booleanisComplex()booleanisFlatArray()booleanisNillable()booleanisWriteOuter()Defaults to true.abstract ObjectreadObject(MessageReader reader, Context context)Read in the XML fragment and create an object.voidsetAbstract(boolean ab)voidsetFlatArray(boolean flatArray)voidsetNillable(boolean nillable)voidsetSchemaType(QName name)voidsetTypeClass(Type typeClass)voidsetTypeMapping(TypeMapping typeMapping)voidsetWriteOuter(boolean writeOuter)StringtoString()booleanusesUtilityTypes()True if this type requires the import of the aegisTypes schema.booleanusesXmime()abstract voidwriteObject(Object object, MessageWriter writer, Context context)Writes the object to the MessageWriter.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.
-
-
-
Field Detail
-
typeClass
protected Type typeClass
-
-
Method Detail
-
readObject
public abstract Object readObject(MessageReader reader, Context context) throws DatabindingException
Read in the XML fragment and create an object.- Parameters:
reader-context-- Returns:
- Throws:
DatabindingException
-
writeObject
public abstract void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException
Writes the object to the MessageWriter.- Parameters:
object-writer-context-- Throws:
DatabindingException
-
writeSchema
public 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.- Parameters:
root- root of the XSD document.
-
addToSchemaElement
public void addToSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement schemaElement)
If the type object merely wants to contribute attributes to the xsd:element element, it can implement this.- Parameters:
schemaElement-
-
getTypeMapping
public TypeMapping getTypeMapping()
- Returns:
- Returns the typeMapping.
-
setTypeMapping
public void setTypeMapping(TypeMapping typeMapping)
- Parameters:
typeMapping- The typeMapping to set.
-
getTypeClass
public Class<?> getTypeClass()
- Returns:
- Returns the java type as a Class. For a generic, return the raw type. For something truly exotic, return null.
-
getType
public Type getType()
- Returns:
- Return the Java type.
-
setTypeClass
public void setTypeClass(Type typeClass)
- Parameters:
typeClass- The typeClass to set.
-
isComplex
public boolean isComplex()
- Returns:
- True if a complex type schema must be written.
-
isAbstract
public boolean isAbstract()
-
setAbstract
public void setAbstract(boolean ab)
-
isNillable
public boolean isNillable()
-
setNillable
public void setNillable(boolean nillable)
-
getDependencies
public Set<AegisType> getDependencies()
Return a set of AegisType dependencies. Returns null if this type has no dependencies.- Returns:
- Set of
AegisTypedependencies
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
getSchemaType
public QName getSchemaType()
- Returns:
- Get the schema type.
-
setSchemaType
public void setSchemaType(QName name)
- Parameters:
name- The qName to set.
-
isWriteOuter
public boolean isWriteOuter()
Defaults to true. False for types that disappear entirely when null, even when nillable.- Returns:
- whether to write xsi:nil for null values.
-
setWriteOuter
public void setWriteOuter(boolean writeOuter)
-
usesXmime
public boolean usesXmime()
-
usesUtilityTypes
public boolean usesUtilityTypes()
True if this type requires the import of the aegisTypes schema.- Returns:
-
hasMinOccurs
public boolean hasMinOccurs()
-
hasMaxOccurs
public boolean hasMaxOccurs()
-
getMinOccurs
public long getMinOccurs()
-
getMaxOccurs
public long getMaxOccurs()
-
isFlatArray
public boolean isFlatArray()
-
setFlatArray
public void setFlatArray(boolean flatArray)
-
-