Package org.apache.cxf.aegis.type.basic
Class BeanType
java.lang.Object
org.apache.cxf.aegis.type.AegisType
org.apache.cxf.aegis.type.basic.BeanType
- Direct Known Subclasses:
StructType
Serializes JavaBeans.
There's a really dangerous coding convention in this class, maintainers beware.
There are two constructor. The no-args constructor defers, until later,
the construction of a BeanTypeInfo. The one-arg constructor gets the BeanTypeInfo passed as a parameter.
Aegis doesn't have any uniform discipline of 'construct, set properties, initialize'. Instead,
each piece of code that uses the type info needs to call getTypeInfo() instead of referencing the
'info' field.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBeanType()Construct a type info.BeanType(BeanTypeInfo info) Construct a type info given a full BeanTypeInfo. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected ObjectcreateFromFault(Context context) If the class is an exception, this will try and instantiate it with information from the XFireFault (if it exists).Create type info based in the type class.protected BeanTypeInfoReturn a set of AegisType dependencies.protected AegisTypegetElementType(QName name, BeanTypeInfo beanTypeInfo, MessageReader reader, Context context) longReturn the AegisType for the superclass if this type's class, if any.Return the type info.booleanbooleanWe need to write a complex type schema for Beans, so return true.readObject(MessageReader reader, Context context) Read in the XML fragment and create an object.protected ObjectreadProperty(Object object, QName name) voidsetTypeClass(Type typeClass) voidsetTypeMapping(TypeMapping typeMapping) toString()protected voidwriteElement(QName name, Object value, AegisType type, MessageWriter writer, Context context) voidwriteObject(Object object, MessageWriter writer, Context context) Writes the object to the MessageWriter.protected voidwriteProperty(QName name, Object object, Object property, Class<?> impl, BeanTypeInfo inf) Write the specified property to a field.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.Methods inherited from class org.apache.cxf.aegis.type.AegisType
addToSchemaElement, equals, getMaxOccurs, getSchemaType, getType, getTypeClass, getTypeMapping, hashCode, hasMaxOccurs, isAbstract, isFlatArray, isNillable, isWriteOuter, setAbstract, setFlatArray, setNillable, setSchemaType, setWriteOuter, usesUtilityTypes, usesXmime
-
Constructor Details
-
BeanType
public BeanType()Construct a type info. Caller must pass in the type class via setTypeClass later. -
BeanType
Construct a type info given a full BeanTypeInfo.- Parameters:
info-
-
-
Method Details
-
readObject
Read in the XML fragment and create an object.- Specified by:
readObjectin classAegisType- Returns:
- Throws:
DatabindingException
-
alwaysAllowNillables
protected boolean alwaysAllowNillables() -
getElementType
protected AegisType getElementType(QName name, BeanTypeInfo beanTypeInfo, MessageReader reader, Context context) -
createFromFault
protected Object createFromFault(Context context) throws SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException If the class is an exception, this will try and instantiate it with information from the XFireFault (if it exists). -
writeProperty
protected void writeProperty(QName name, Object object, Object property, Class<?> impl, BeanTypeInfo inf) throws DatabindingException Write the specified property to a field.- Throws:
DatabindingException
-
writeObject
public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException Writes the object to the MessageWriter.- Specified by:
writeObjectin classAegisType- Throws:
DatabindingException
-
writeElement
protected void writeElement(QName name, Object value, AegisType type, MessageWriter writer, Context context) -
readProperty
-
setTypeClass
- Overrides:
setTypeClassin classAegisType- Parameters:
typeClass- The typeClass to set.
-
isComplex
public boolean isComplex()We need to write a complex type schema for Beans, so return true. -
getDependencies
Return a set of AegisType dependencies. Returns null if this type has no dependencies.- Overrides:
getDependenciesin classAegisType- Returns:
- Set of
AegisTypedependencies
-
getBeanTypeInfoWithProperty
-
getSuperType
Return the AegisType for the superclass if this type's class, if any.- Returns:
-
getTypeInfo
Return the type info.- Returns:
-
createTypeInfo
Create type info based in the type class.- Returns:
-
toString
-
getMinOccurs
public long getMinOccurs()- Overrides:
getMinOccursin classAegisType
-
hasMinOccurs
public boolean hasMinOccurs()- Overrides:
hasMinOccursin classAegisType
-
setTypeMapping
- Overrides:
setTypeMappingin classAegisType- Parameters:
typeMapping- The typeMapping to set.
-
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.
-