Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.output

public abstract Class XmlOutputAbstractImpl

extends Object
implements XmlOutput
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.runtime.output.XMLStreamWriterOutput, org.glassfish.jaxb.runtime.v2.runtime.output.ForkXmlOutput, org.glassfish.jaxb.runtime.v2.runtime.output.MTOMXmlOutput, org.glassfish.jaxb.runtime.v2.runtime.output.SAXOutput, org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput, org.glassfish.jaxb.runtime.v2.runtime.output.XMLEventWriterOutput
Imports
org.glassfish.jaxb.runtime.v2.runtime.Name, .XMLSerializer, org.xml.sax.SAXException, javax.xml.stream.XMLStreamException, java.io.IOException

Abstract implementation of XmlOutput Implements the optimal methods, where defer to the non-optimal methods.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
protected NamespaceContextImpl
nsContext

Set by the marshaller before the start tag is written for the root element.

protected int[]
nsUriIndex2prefixIndex

The conversion table from the namespace URI index to prefix index.

protected XMLSerializer

Constructor Summary

AccessConstructor and Description
protected
XmlOutputAbstractImpl()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
public abstract void
attribute(int
-1 if this attribute does not have a prefix (this handling differs from that of elements.)
prefix
,
String localName, String value)

Redeclares org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.attribute.

public void
public abstract void
public void
endDocument(boolean
false if we are writing the whole document.
fragment
)

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endDocument.

Called at the very end.

public abstract void
public void
public abstract void
public void
startDocument(XMLSerializer
the XMLSerializer that coordinates this whole marshalling episode.
serializer
,
boolean
true if we are marshalling a fragment.
fragment
,
int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext)

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.startDocument.

Called at the very beginning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nsContextback to summary
protected NamespaceContextImpl nsContext

Set by the marshaller before the start tag is written for the root element.

nsUriIndex2prefixIndexback to summary
protected int[] nsUriIndex2prefixIndex

The conversion table from the namespace URI index to prefix index. This array is shared with XMLSerializer and is updated by it automatically. This allows Name#nsUriIndex to be converted to prefix index (for NamespaceContextImpl) quickly.

serializerback to summary
protected XMLSerializer serializer

Constructor Detail

XmlOutputAbstractImplback to summary
protected XmlOutputAbstractImpl()

Default constructor.

Method Detail

attributeback to summary
public void attribute(Name name, String value) throws IOException, XMLStreamException

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.attribute.

Annotations
@Override
attributeback to summary
public abstract void attribute(int prefix, String localName, String value) throws IOException, XMLStreamException

Redeclares org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.attribute.

Parameters
prefix:int

-1 if this attribute does not have a prefix (this handling differs from that of elements.)

Annotations
@Override
beginStartTagback to summary
public void beginStartTag(Name name) throws IOException, XMLStreamException

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.beginStartTag.

Writes a start tag.

At this point nsContext holds namespace declarations needed for this new element.

This method is used for writing tags that are indexed.

Annotations
@Override
beginStartTagback to summary
public abstract void beginStartTag(int prefix, String localName) throws IOException, XMLStreamException

Redeclares org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.beginStartTag.

Annotations
@Override
endDocumentback to summary
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endDocument.

Called at the very end.

Parameters
fragment:boolean

false if we are writing the whole document.

Annotations
@Override
endStartTagback to summary
public abstract void endStartTag() throws IOException, SAXException

Redeclares org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endStartTag.

Annotations
@Override
endTagback to summary
public void endTag(Name name) throws IOException, SAXException, XMLStreamException

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endTag.

Annotations
@Override
endTagback to summary
public abstract void endTag(int prefix, String localName) throws IOException, SAXException, XMLStreamException

Redeclares org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endTag.

Annotations
@Override
startDocumentback to summary
public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.startDocument.

Called at the very beginning.

Parameters
serializer:XMLSerializer

the XMLSerializer that coordinates this whole marshalling episode.

fragment:boolean

true if we are marshalling a fragment.

Annotations
@Override