public abstract class Serializer extends Object
| Constructor and Description |
|---|
Serializer(org.apache.axiom.om.OMSerializable root,
boolean namespaceRepairing,
boolean preserveNamespaceContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addAttribute(String prefix,
String namespaceURI,
String localName,
String type,
String value)
Add the given attribute to the element.
|
protected abstract void |
addNamespace(String prefix,
String namespaceURI)
Add the given namespace to the element.
|
protected abstract void |
beginStartElement(String prefix,
String namespaceURI,
String localName)
Prepare to write an element start tag.
|
void |
copyEvent(javax.xml.stream.XMLStreamReader reader,
org.apache.axiom.ext.stax.datahandler.DataHandlerReader dataHandlerReader) |
protected abstract void |
finishStartElement() |
protected abstract boolean |
isAssociated(String prefix,
String namespace) |
void |
serialize(org.apache.axiom.om.OMDataSource dataSource)
Serialize the given data source.
|
protected abstract void |
serializePushOMDataSource(org.apache.axiom.om.OMDataSource dataSource)
Serialize the given data source using
OMDataSource.serialize(XMLStreamWriter). |
void |
serializeStartpart(org.apache.axiom.om.OMElement element) |
abstract void |
writeComment(String data) |
abstract void |
writeDataHandler(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider,
String contentID,
boolean optimize) |
abstract void |
writeDataHandler(javax.activation.DataHandler dataHandler,
String contentID,
boolean optimize) |
abstract void |
writeDTD(String rootName,
String publicId,
String systemId,
String internalSubset) |
abstract void |
writeEndDocument() |
abstract void |
writeEndElement() |
abstract void |
writeEntityRef(String name) |
abstract void |
writeProcessingInstruction(String target,
String data) |
abstract void |
writeStartDocument(String version) |
abstract void |
writeStartDocument(String encoding,
String version) |
abstract void |
writeText(int type,
String data) |
public Serializer(org.apache.axiom.om.OMSerializable root,
boolean namespaceRepairing,
boolean preserveNamespaceContext)
root - the root node of the object model subtree that is being serialized; this
information is used by the serializer in scenarios that require access to the
namespace context of the parent of the root nodenamespaceRepairing - indicates if the serializer should perform namespace repairingpreserveNamespaceContext - indicates if the namespace context determined by the ancestors of the root node
should be strictly preserved in the outputpublic final void serializeStartpart(org.apache.axiom.om.OMElement element)
throws OutputException
OutputExceptionpublic final void copyEvent(javax.xml.stream.XMLStreamReader reader, org.apache.axiom.ext.stax.datahandler.DataHandlerReader dataHandlerReader) throws OutputException
OutputExceptionpublic final void serialize(org.apache.axiom.om.OMDataSource dataSource)
throws OutputException
dataSource - the data source to serializeOutputException - if an error occurs while writing the dataorg.apache.axiom.om.DeferredParsingException - if an error occurs while reading from the data sourceprotected abstract boolean isAssociated(String prefix, String namespace) throws OutputException
OutputExceptionpublic abstract void writeStartDocument(String version) throws OutputException
OutputExceptionpublic abstract void writeStartDocument(String encoding, String version) throws OutputException
OutputExceptionpublic abstract void writeDTD(String rootName, String publicId, String systemId, String internalSubset) throws OutputException
OutputExceptionprotected abstract void beginStartElement(String prefix, String namespaceURI, String localName) throws OutputException
addNamespace(String, String) and
addAttribute(String, String, String, String, String) and a single call to
finishStartElement().prefix - the prefix of the element; never nullnamespaceURI - the namespace URI of the element; never nulllocalName - the local name of the element; never nullOutputExceptionprotected abstract void addNamespace(String prefix, String namespaceURI) throws OutputException
XMLStreamWriter that serializePushOMDataSource(OMDataSource) passes to
OMDataSource.serialize(XMLStreamWriter) if an OMDataSource is serialized in
the scope of the current element (and of course unless the namespace binding is hidden by a
namespace defined on a nested element).
prefix - the namespace prefix; never nullnamespaceURI - the namespace URI; never nullOutputExceptionprotected abstract void addAttribute(String prefix, String namespaceURI, String localName, String type, String value) throws OutputException
prefix - the namespace prefix of the attribute; never nullnamespaceURI - the namespace URI or the attribute; never nulllocalName - the local name of the attribute; never nulltype - the attribute type (e.g. CDATA); never nullvalue - the value of the attribute; never nullOutputExceptionprotected abstract void finishStartElement()
throws OutputException
OutputExceptionpublic abstract void writeEndElement()
throws OutputException
OutputExceptionpublic abstract void writeText(int type,
String data)
throws OutputException
OutputExceptionpublic abstract void writeComment(String data) throws OutputException
OutputExceptionpublic abstract void writeProcessingInstruction(String target, String data) throws OutputException
OutputExceptionpublic abstract void writeEntityRef(String name) throws OutputException
OutputExceptionpublic abstract void writeDataHandler(javax.activation.DataHandler dataHandler,
String contentID,
boolean optimize)
throws OutputException
OutputExceptionpublic abstract void writeDataHandler(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider,
String contentID,
boolean optimize)
throws OutputException
OutputExceptionprotected abstract void serializePushOMDataSource(org.apache.axiom.om.OMDataSource dataSource)
throws OutputException
OMDataSource.serialize(XMLStreamWriter). The
implementation must construct an appropriate XMLStreamWriter instance to pass to that
method and wrap any XMLStreamException that may be thrown in an
OutputException or DeferredParsingException.dataSource - the data source to serializeOutputException - if an error occurs while writing the dataorg.apache.axiom.om.DeferredParsingException - if an error occurs while reading from the data sourcepublic abstract void writeEndDocument()
throws OutputException
OutputExceptionCopyright © The Apache Software Foundation. All Rights Reserved.