org.apache.axis.encoding.ser

Class SimpleSerializer

public class SimpleSerializer extends Object implements SimpleValueSerializer

Serializer for primitives and anything simple whose value is obtained with toString()

Author: Rich Scheuerle

Field Summary
ClassjavaType
static StringVALUE_PROPERTY
QNamexmlType
Constructor Summary
SimpleSerializer(Class javaType, QName xmlType)
SimpleSerializer(Class javaType, QName xmlType, TypeDesc typeDesc)
Method Summary
StringgetMechanismType()
StringgetValueAsString(Object value, SerializationContext context)
voidserialize(QName name, Attributes attributes, Object value, SerializationContext context)
Serialize a primitive or simple value.
ElementwriteSchema(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.

Field Detail

javaType

public Class javaType

VALUE_PROPERTY

public static final String VALUE_PROPERTY

xmlType

public QName xmlType

Constructor Detail

SimpleSerializer

public SimpleSerializer(Class javaType, QName xmlType)

SimpleSerializer

public SimpleSerializer(Class javaType, QName xmlType, TypeDesc typeDesc)

Method Detail

getMechanismType

public String getMechanismType()

getValueAsString

public String getValueAsString(Object value, SerializationContext context)

serialize

public void serialize(QName name, Attributes attributes, Object value, SerializationContext context)
Serialize a primitive or simple value. If the object to serialize is a primitive, the Object value below is the associated java.lang class. To determine if the original value is a java.lang class or a primitive, consult the javaType class.

writeSchema

public 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.

Parameters: javaType the Java Class we're writing out schema for types the Java2WSDL Types object which holds the context for the WSDL being generated.

Returns: a type element containing a schema simpleType/complexType

See Also: Types

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.