org.apache.axis.encoding.ser
Class BeanSerializer
java.lang.Object
org.apache.axis.encoding.ser.BeanSerializer
- java.io.Serializable, Serializer, Serializer
public class BeanSerializer
extends java.lang.Object
General purpose serializer/deserializerFactory for an arbitrary java bean.
- Sam Ruby
- Rich Scheuerle
- Tom Jordahl
String | getMechanismType()
|
protected Attributes | getObjectAttributes(Object value, Attributes attributes, SerializationContext context) - Check for meta-data in the bean that will tell us if any of the
properties are actually attributes, add those to the element
attribute list
|
void | serialize(QName name, Attributes attributes, Object value, SerializationContext context) - Serialize a bean.
|
protected void | writeAttribute(Types types, String fieldName, Class fieldType, QName fieldXmlType, Element where) - write aa attribute element and append it to the 'where' Node
|
protected void | writeField(Types types, String fieldName, QName xmlType, Class fieldType, boolean isUnbounded, boolean isOmittable, Element where, boolean isAnonymous, QName itemQName) - write a schema representation of the given Class field and append it to
the where Node, recurse on complex types
|
Element | writeSchema(Class javaType, Types types) - Return XML schema for the specified type, suitable for insertion into
the <types> element of a WSDL document, or underneath an
<element> or <attribute> declaration.
|
log
protected static Log log
BeanSerializer
public BeanSerializer(Class javaType,
QName xmlType)
BeanSerializer
public BeanSerializer(Class javaType,
QName xmlType,
TypeDesc typeDesc)
getObjectAttributes
protected Attributes getObjectAttributes(Object value,
Attributes attributes,
SerializationContext context)
Check for meta-data in the bean that will tell us if any of the
properties are actually attributes, add those to the element
attribute list
value
- the object we are serializing
- attributes for this element, null if none
serialize
public void serialize(QName name,
Attributes attributes,
Object value,
SerializationContext context)
throws IOException
Serialize a bean. Done simply by serializing each bean property.
- serialize in interface Serializer
name
- is the element nameattributes
- are the attributes...serialize is free to add more.value
- is the valuecontext
- is the SerializationContext
writeAttribute
protected void writeAttribute(Types types,
String fieldName,
Class fieldType,
QName fieldXmlType,
Element where)
throws Exception
write aa attribute element and append it to the 'where' Node
fieldName
- name of the fieldfieldType
- type of the fieldwhere
- location for the generated schema node
writeField
protected void writeField(Types types,
String fieldName,
QName xmlType,
Class fieldType,
boolean isUnbounded,
boolean isOmittable,
Element where,
boolean isAnonymous,
QName itemQName)
throws Exception
write a schema representation of the given Class field and append it to
the where Node, recurse on complex types
fieldName
- name of the fieldxmlType
- the schema type of the fieldfieldType
- type of the fieldisUnbounded
- causes maxOccurs="unbounded" if setwhere
- location for the generated schema nodeitemQName
-
writeSchema
public Element writeSchema(Class javaType,
Types types)
throws Exception
Return XML schema for the specified type, suitable for insertion into
the <types> element of a WSDL document, or underneath an
<element> or <attribute> declaration.
- writeSchema in interface Serializer
javaType
- the Java Class we're writing out schema fortypes
- the Java2WSDL Types object which holds the context
for the WSDL being generated.
- a type element containing a schema simpleType/complexType
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.