Class XmlOutputAbstractImpl
java.lang.Object
com.sun.xml.bind.v2.runtime.output.XmlOutputAbstractImpl
- All Implemented Interfaces:
XmlOutput
- Direct Known Subclasses:
ForkXmlOutput,MTOMXmlOutput,SAXOutput,UTF8XmlOutput,XMLEventWriterOutput,XMLStreamWriterOutput
Abstract implementation of
XmlOutput
Implements the optimal methods, where defer to
the non-optimal methods.- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NamespaceContextImplSet by the marshaller before the start tag is written for the root element.protected int[]The conversion table from the namespace URI index to prefix index.protected XMLSerializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidvoidabstract voidbeginStartTag(int prefix, String localName) voidbeginStartTag(Name name) Writes a start tag.voidendDocument(boolean fragment) Called at the very end.abstract voidabstract voidvoidvoidstartDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) Called at the very beginning.
-
Field Details
-
nsUriIndex2prefixIndex
protected int[] nsUriIndex2prefixIndexThe conversion table from the namespace URI index to prefix index. This array is shared withXMLSerializerand is updated by it automatically. This allowsName.nsUriIndexto be converted to prefix index (forNamespaceContextImpl) quickly. -
nsContext
Set by the marshaller before the start tag is written for the root element. -
serializer
-
-
Constructor Details
-
XmlOutputAbstractImpl
public XmlOutputAbstractImpl()
-
-
Method Details
-
startDocument
public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException Called at the very beginning.- Specified by:
startDocumentin interfaceXmlOutput- Parameters:
serializer- theXMLSerializerthat coordinates this whole marshalling episode.fragment- true if we are marshalling a fragment.- Throws:
IOExceptionSAXExceptionXMLStreamException
-
endDocument
Called at the very end.- Specified by:
endDocumentin interfaceXmlOutput- Parameters:
fragment- false if we are writing the whole document.- Throws:
IOExceptionSAXExceptionXMLStreamException
-
beginStartTag
Writes a start tag.At this point
nsContextholds namespace declarations needed for this new element.This method is used for writing tags that are indexed.
- Specified by:
beginStartTagin interfaceXmlOutput- Throws:
IOExceptionXMLStreamException
-
beginStartTag
public abstract void beginStartTag(int prefix, String localName) throws IOException, XMLStreamException - Specified by:
beginStartTagin interfaceXmlOutput- Throws:
IOExceptionXMLStreamException
-
attribute
- Specified by:
attributein interfaceXmlOutput- Throws:
IOExceptionXMLStreamException
-
attribute
public abstract void attribute(int prefix, String localName, String value) throws IOException, XMLStreamException - Specified by:
attributein interfaceXmlOutput- Parameters:
prefix- -1 if this attribute does not have a prefix (this handling differs from that of elements.)- Throws:
IOExceptionXMLStreamException
-
endStartTag
- Specified by:
endStartTagin interfaceXmlOutput- Throws:
IOExceptionSAXException
-
endTag
- Specified by:
endTagin interfaceXmlOutput- Throws:
IOExceptionSAXExceptionXMLStreamException
-
endTag
public abstract void endTag(int prefix, String localName) throws IOException, SAXException, XMLStreamException - Specified by:
endTagin interfaceXmlOutput- Throws:
IOExceptionSAXExceptionXMLStreamException
-