EnumSerializerpublic class EnumSerializer extends SimpleSerializer Serializer for a JAX-RPC enum. |
Fields Summary |
---|
protected static Log | log | private Method | toStringMethod |
Constructors Summary |
---|
public EnumSerializer(Class javaType, QName xmlType)
super(javaType, xmlType);
|
Methods Summary |
---|
public java.lang.String | getValueAsString(java.lang.Object value, org.apache.axis.encoding.SerializationContext context)
// Invoke the toString method on the enumeration class and
// write out the result as a string.
try {
if (toStringMethod == null) {
toStringMethod = javaType.getMethod("toString", null);
}
return (String) toStringMethod.invoke(value, null);
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
}
return null;
| public void | serialize(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes, java.lang.Object value, org.apache.axis.encoding.SerializationContext context)Serialize an enumeration
context.startElement(name, attributes);
context.writeString(getValueAsString(value, context));
context.endElement();
| public org.w3c.dom.Element | writeSchema(java.lang.Class javaType, org.apache.axis.wsdl.fromJava.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.
// Use Types helper method.
return types.writeEnumType(xmlType, javaType);
|
|