CastorSerializerpublic class CastorSerializer extends Object implements org.apache.axis.encoding.Serializer
Fields Summary |
---|
protected static Log | log |
Methods Summary |
---|
public java.lang.String | getMechanismType()
return Constants.AXIS_SAX;
| public void | serialize(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes, java.lang.Object value, org.apache.axis.encoding.SerializationContext context)Serialize a Castor object.
try {
AxisContentHandler hand = new AxisContentHandler(context);
Marshaller marshaller = new Marshaller(hand);
// Don't include the DOCTYPE, otherwise an exception occurs due to
//2 DOCTYPE defined in the document. The XML fragment is included in
//an XML document containing already a DOCTYPE
marshaller.setMarshalAsDocument(false);
String localPart = name.getLocalPart();
int arrayDims = localPart.indexOf('[");
if (arrayDims != -1) {
localPart = localPart.substring(0, arrayDims);
}
marshaller.setRootElement(localPart);
// Marshall the Castor object into the stream (sink)
marshaller.marshal(value);
} catch (MarshalException me) {
log.error(Messages.getMessage("castorMarshalException00"), me);
throw new IOException(Messages.getMessage(
"castorMarshalException00")
+ me.getLocalizedMessage());
} catch (ValidationException ve) {
log.error(Messages.getMessage("castorValidationException00"), ve);
throw new IOException(Messages.getMessage(
"castorValidationException00")
+ ve.getLocation() + ": " + ve.getLocalizedMessage());
}
| 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.
return null;
|
|