com.sun.xml.bind.v2.runtime.output

Class XmlOutputAbstractImpl

public abstract class XmlOutputAbstractImpl extends Object implements XmlOutput

Abstract implementation of XmlOutput Implements the optimal methods, where defer to the non-optimal methods.
Field Summary
protected NamespaceContextImplnsContext
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 XMLSerializerserializer
Method Summary
voidattribute(Name name, String value)
abstract voidattribute(int prefix, String localName, String value)
voidbeginStartTag(Name name)
Writes a start tag.
abstract voidbeginStartTag(int prefix, String localName)
voidendDocument(boolean fragment)
Called at the very end.
abstract voidendStartTag()
voidendTag(Name name)
abstract voidendTag(int prefix, String localName)
voidstartDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext)
Called at the very beginning.

Field Detail

nsContext

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

nsUriIndex2prefixIndex

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 nsUriIndex to be converted to prefix index (for NamespaceContextImpl) quickly.

serializer

protected XMLSerializer serializer

Method Detail

attribute

public void attribute(Name name, String value)

attribute

public abstract void attribute(int prefix, String localName, String value)

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

beginStartTag

public void beginStartTag(Name name)
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.

beginStartTag

public abstract void beginStartTag(int prefix, String localName)

endDocument

public void endDocument(boolean fragment)
Called at the very end.

Parameters: fragment false if we are writing the whole document.

endStartTag

public abstract void endStartTag()

endTag

public void endTag(Name name)

endTag

public abstract void endTag(int prefix, String localName)

startDocument

public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext)
Called at the very beginning.

Parameters: serializer the XMLSerializer that coordinates this whole marshalling episode. fragment true if we are marshalling a fragment.