public class StAXSerializer extends Serializer
| Constructor and Description |
|---|
StAXSerializer(org.apache.axiom.om.OMSerializable root,
javax.xml.stream.XMLStreamWriter writer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttribute(String prefix,
String namespaceURI,
String localName,
String type,
String value)
Add the given attribute to the element.
|
protected void |
addNamespace(String prefix,
String namespaceURI)
Add the given namespace to the element.
|
protected void |
beginStartElement(String prefix,
String namespaceURI,
String localName)
Prepare to write an element start tag.
|
protected void |
finishStartElement() |
protected boolean |
isAssociated(String prefix,
String namespace) |
protected void |
serializePushOMDataSource(org.apache.axiom.om.OMDataSource dataSource)
Serialize the given data source using
OMDataSource.serialize(XMLStreamWriter). |
void |
writeComment(String data) |
void |
writeDataHandler(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider,
String contentID,
boolean optimize) |
void |
writeDataHandler(javax.activation.DataHandler dataHandler,
String contentID,
boolean optimize) |
void |
writeDTD(String rootName,
String publicId,
String systemId,
String internalSubset) |
void |
writeEndDocument() |
void |
writeEndElement() |
void |
writeEntityRef(String name) |
void |
writeProcessingInstruction(String target,
String data) |
void |
writeStartDocument(String version) |
void |
writeStartDocument(String encoding,
String version) |
void |
writeText(int type,
String data) |
copyEvent, serialize, serializeStartpartpublic StAXSerializer(org.apache.axiom.om.OMSerializable root,
javax.xml.stream.XMLStreamWriter writer)
protected void serializePushOMDataSource(org.apache.axiom.om.OMDataSource dataSource)
throws OutputException
SerializerOMDataSource.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.serializePushOMDataSource in class SerializerdataSource - the data source to serializeOutputException - if an error occurs while writing the datapublic void writeStartDocument(String version) throws OutputException
writeStartDocument in class SerializerOutputExceptionpublic void writeStartDocument(String encoding, String version) throws OutputException
writeStartDocument in class SerializerOutputExceptionpublic void writeDTD(String rootName, String publicId, String systemId, String internalSubset) throws OutputException
writeDTD in class SerializerOutputExceptionprotected void beginStartElement(String prefix, String namespaceURI, String localName) throws OutputException
SerializerSerializer.addNamespace(String, String) and
Serializer.addAttribute(String, String, String, String, String) and a single call to
Serializer.finishStartElement().beginStartElement in class Serializerprefix - the prefix of the element; never nullnamespaceURI - the namespace URI of the element; never nulllocalName - the local name of the element; never nullOutputExceptionprotected void addNamespace(String prefix, String namespaceURI) throws OutputException
SerializerXMLStreamWriter that Serializer.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).
addNamespace in class Serializerprefix - the namespace prefix; never nullnamespaceURI - the namespace URI; never nullOutputExceptionprotected void addAttribute(String prefix, String namespaceURI, String localName, String type, String value) throws OutputException
SerializeraddAttribute in class Serializerprefix - 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 void finishStartElement()
throws OutputException
finishStartElement in class SerializerOutputExceptionprotected boolean isAssociated(String prefix, String namespace) throws OutputException
isAssociated in class Serializerprefix - namespace - OutputExceptionpublic void writeEndElement()
throws OutputException
writeEndElement in class SerializerOutputExceptionpublic void writeText(int type,
String data)
throws OutputException
writeText in class SerializerOutputExceptionpublic void writeComment(String data) throws OutputException
writeComment in class SerializerOutputExceptionpublic void writeProcessingInstruction(String target, String data) throws OutputException
writeProcessingInstruction in class SerializerOutputExceptionpublic void writeEntityRef(String name) throws OutputException
writeEntityRef in class SerializerOutputExceptionpublic void writeDataHandler(javax.activation.DataHandler dataHandler,
String contentID,
boolean optimize)
throws OutputException
writeDataHandler in class SerializerOutputExceptionpublic void writeDataHandler(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider,
String contentID,
boolean optimize)
throws OutputException
writeDataHandler in class SerializerOutputExceptionpublic void writeEndDocument()
throws OutputException
writeEndDocument in class SerializerOutputExceptionCopyright © The Apache Software Foundation. All Rights Reserved.