public abstract class XmlOutputAbstractImpl extends Object implements XmlOutput
XmlOutput
Implements the optimal methods, where defer to
the non-optimal methods.Modifier and Type | Field 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 |
serializer |
Constructor and Description |
---|
XmlOutputAbstractImpl() |
Modifier and Type | Method and Description |
---|---|
abstract void |
attribute(int prefix,
String localName,
String value) |
void |
attribute(Name name,
String value) |
abstract void |
beginStartTag(int prefix,
String localName) |
void |
beginStartTag(Name name)
Writes a start tag.
|
void |
endDocument(boolean fragment)
Called at the very end.
|
abstract void |
endStartTag() |
abstract void |
endTag(int prefix,
String localName) |
void |
endTag(Name name) |
void |
startDocument(XMLSerializer serializer,
boolean fragment,
int[] nsUriIndex2prefixIndex,
NamespaceContextImpl nsContext)
Called at the very beginning.
|
protected int[] nsUriIndex2prefixIndex
XMLSerializer
and
is updated by it automatically.
This allows Name.nsUriIndex
to be converted to prefix index
(for NamespaceContextImpl
) quickly.protected NamespaceContextImpl nsContext
protected XMLSerializer serializer
public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException
startDocument
in interface XmlOutput
serializer
- the XMLSerializer
that coordinates this whole marshalling episode.fragment
- true if we are marshalling a fragment.IOException
SAXException
XMLStreamException
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException
endDocument
in interface XmlOutput
fragment
- false if we are writing the whole document.IOException
SAXException
XMLStreamException
public void beginStartTag(Name name) throws IOException, XMLStreamException
At this point nsContext
holds namespace declarations needed for this
new element.
This method is used for writing tags that are indexed.
beginStartTag
in interface XmlOutput
IOException
XMLStreamException
public abstract void beginStartTag(int prefix, String localName) throws IOException, XMLStreamException
beginStartTag
in interface XmlOutput
IOException
XMLStreamException
public void attribute(Name name, String value) throws IOException, XMLStreamException
attribute
in interface XmlOutput
IOException
XMLStreamException
public abstract void attribute(int prefix, String localName, String value) throws IOException, XMLStreamException
attribute
in interface XmlOutput
prefix
- -1 if this attribute does not have a prefix
(this handling differs from that of elements.)IOException
XMLStreamException
public abstract void endStartTag() throws IOException, SAXException
endStartTag
in interface XmlOutput
IOException
SAXException
public void endTag(Name name) throws IOException, SAXException, XMLStreamException
endTag
in interface XmlOutput
IOException
SAXException
XMLStreamException
public abstract void endTag(int prefix, String localName) throws IOException, SAXException, XMLStreamException
endTag
in interface XmlOutput
IOException
SAXException
XMLStreamException
Copyright © 2017 JBoss by Red Hat. All rights reserved.