|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.sun.xml.fastinfoset.Encoder
com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
public class StAXDocumentSerializer
The Fast Infoset StAX serializer.
Instantiate this serializer to serialize a fast infoset document in accordance with the StAX API.
More than one fast infoset document may be encoded to the
OutputStream.
| Field Summary | |
|---|---|
protected java.lang.String[] |
_attributesArray
List of attributes qnames and values defined in the current element. |
protected int |
_attributesArrayIndex
|
protected java.lang.String |
_currentLocalName
Local name of current element. |
protected java.lang.String |
_currentPrefix
Prefix of current element. |
protected java.lang.String |
_currentUri
Namespace of current element. |
protected java.lang.String |
_encoding
|
protected boolean |
_inStartElement
This flag indicates when there is a pending start element event. |
protected boolean |
_isEmptyElement
This flag indicates if the current element is empty. |
protected StAXManager |
_manager
|
protected java.lang.String[] |
_namespacesArray
List of namespaces defined in the current element. |
protected int |
_namespacesArrayIndex
|
protected NamespaceContextImplementation |
_nsContext
Mapping between uris and prefixes. |
protected boolean[] |
_nsSupportContextStack
|
protected int |
_stackCount
|
| Constructor Summary | |
|---|---|
StAXDocumentSerializer()
|
|
StAXDocumentSerializer(java.io.OutputStream outputStream)
|
|
StAXDocumentSerializer(java.io.OutputStream outputStream,
StAXManager manager)
|
|
| Method Summary | |
|---|---|
void |
close()
|
protected void |
encodeTerminationAndCurrentElement(boolean terminateAfter)
|
void |
flush()
|
int |
getLocalNameIndex()
Get the current index that was applied to an [local name] of an Element or Attribute Information Item. |
javax.xml.namespace.NamespaceContext |
getNamespaceContext()
|
int |
getNextAttributeIndex()
Get the next index to apply to an Attribute Information Item. |
int |
getNextElementIndex()
Get the next index to apply to an Element Information Item. |
int |
getNextLocalNameIndex()
Get the next index to apply to an [local name] of an Element or Attribute Information Item. |
java.lang.String |
getPrefix(java.lang.String uri)
|
java.lang.Object |
getProperty(java.lang.String name)
|
void |
initiateLowLevelWriting()
Initiate low level writing of an element fragment. |
void |
reset()
Reset the encoder for reuse encoding another XML infoset. |
void |
setDefaultNamespace(java.lang.String uri)
|
void |
setEncoding(java.lang.String encoding)
|
void |
setManager(StAXManager manager)
|
void |
setNamespaceContext(javax.xml.namespace.NamespaceContext context)
Sets the current namespace context for prefix and uri bindings. |
void |
setPrefix(java.lang.String prefix,
java.lang.String uri)
|
void |
writeAttribute(java.lang.String localName,
java.lang.String value)
|
void |
writeAttribute(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
|
void |
writeAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
|
void |
writeCData(java.lang.String text)
|
void |
writeCharacters(char[] text,
int start,
int len)
|
void |
writeCharacters(java.lang.String text)
|
void |
writeComment(java.lang.String data)
|
void |
writeDefaultNamespace(java.lang.String namespaceURI)
|
void |
writeDTD(java.lang.String dtd)
|
void |
writeEmptyElement(java.lang.String localName)
|
void |
writeEmptyElement(java.lang.String namespaceURI,
java.lang.String localName)
|
void |
writeEmptyElement(java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
|
void |
writeEndDocument()
|
void |
writeEndElement()
|
void |
writeEntityRef(java.lang.String name)
|
boolean |
writeLowLevelAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName)
Write an attribute. |
void |
writeLowLevelAttributeIndexed(int index)
|
void |
writeLowLevelAttributeValue(java.lang.String value)
|
void |
writeLowLevelEndElement()
|
void |
writeLowLevelEndNamespaces()
|
void |
writeLowLevelEndStartElement()
|
void |
writeLowLevelNamespace(java.lang.String prefix,
java.lang.String namespaceName)
|
void |
writeLowLevelOctets(byte[] octets,
int length)
|
void |
writeLowLevelStartAttributes()
|
boolean |
writeLowLevelStartElement(int type,
java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
Write the start of an element. |
void |
writeLowLevelStartElementIndexed(int type,
int index)
|
void |
writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
byte[] utf8LocalName,
java.lang.String namespaceURI)
|
void |
writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
int localNameIndex,
java.lang.String namespaceURI)
|
void |
writeLowLevelStartNamespaces()
|
void |
writeLowLevelTerminationAndMark()
|
void |
writeLowLevelText(char[] text,
int length)
|
void |
writeLowLevelText(java.lang.String text)
|
void |
writeNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
|
void |
writeOctets(byte[] b,
int start,
int len)
|
void |
writeProcessingInstruction(java.lang.String target)
|
void |
writeProcessingInstruction(java.lang.String target,
java.lang.String data)
|
void |
writeStartDocument()
|
void |
writeStartDocument(java.lang.String version)
|
void |
writeStartDocument(java.lang.String encoding,
java.lang.String version)
|
void |
writeStartElement(java.lang.String localName)
|
void |
writeStartElement(java.lang.String namespaceURI,
java.lang.String localName)
|
void |
writeStartElement(java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StAXManager _manager
protected java.lang.String _encoding
protected java.lang.String _currentLocalName
protected java.lang.String _currentUri
protected java.lang.String _currentPrefix
protected boolean _inStartElement
protected boolean _isEmptyElement
protected java.lang.String[] _attributesArray
protected int _attributesArrayIndex
protected boolean[] _nsSupportContextStack
protected int _stackCount
protected NamespaceContextImplementation _nsContext
protected java.lang.String[] _namespacesArray
protected int _namespacesArrayIndex
| Constructor Detail |
|---|
public StAXDocumentSerializer()
public StAXDocumentSerializer(java.io.OutputStream outputStream)
public StAXDocumentSerializer(java.io.OutputStream outputStream,
StAXManager manager)
| Method Detail |
|---|
public void reset()
Encoder
reset in interface FastInfosetSerializerreset in class Encoder
public void writeStartDocument()
throws javax.xml.stream.XMLStreamException
writeStartDocument in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeStartDocument(java.lang.String version)
throws javax.xml.stream.XMLStreamException
writeStartDocument in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeStartDocument(java.lang.String encoding,
java.lang.String version)
throws javax.xml.stream.XMLStreamException
writeStartDocument in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEndDocument()
throws javax.xml.stream.XMLStreamException
writeEndDocument in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void close()
throws javax.xml.stream.XMLStreamException
close in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void flush()
throws javax.xml.stream.XMLStreamException
flush in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeStartElement(java.lang.String localName)
throws javax.xml.stream.XMLStreamException
writeStartElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeStartElement(java.lang.String namespaceURI,
java.lang.String localName)
throws javax.xml.stream.XMLStreamException
writeStartElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeStartElement(java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
throws javax.xml.stream.XMLStreamException
writeStartElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEmptyElement(java.lang.String localName)
throws javax.xml.stream.XMLStreamException
writeEmptyElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEmptyElement(java.lang.String namespaceURI,
java.lang.String localName)
throws javax.xml.stream.XMLStreamException
writeEmptyElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEmptyElement(java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
throws javax.xml.stream.XMLStreamException
writeEmptyElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEndElement()
throws javax.xml.stream.XMLStreamException
writeEndElement in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeAttribute(java.lang.String localName,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
writeAttribute in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeAttribute(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
writeAttribute in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
writeAttribute in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
throws javax.xml.stream.XMLStreamException
writeNamespace in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeDefaultNamespace(java.lang.String namespaceURI)
throws javax.xml.stream.XMLStreamException
writeDefaultNamespace in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeComment(java.lang.String data)
throws javax.xml.stream.XMLStreamException
writeComment in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeProcessingInstruction(java.lang.String target)
throws javax.xml.stream.XMLStreamException
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeProcessingInstruction(java.lang.String target,
java.lang.String data)
throws javax.xml.stream.XMLStreamException
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeCData(java.lang.String text)
throws javax.xml.stream.XMLStreamException
writeCData in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeDTD(java.lang.String dtd)
throws javax.xml.stream.XMLStreamException
writeDTD in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeEntityRef(java.lang.String name)
throws javax.xml.stream.XMLStreamException
writeEntityRef in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeCharacters(java.lang.String text)
throws javax.xml.stream.XMLStreamException
writeCharacters in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void writeCharacters(char[] text,
int start,
int len)
throws javax.xml.stream.XMLStreamException
writeCharacters in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public java.lang.String getPrefix(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
getPrefix in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void setPrefix(java.lang.String prefix,
java.lang.String uri)
throws javax.xml.stream.XMLStreamException
setPrefix in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void setDefaultNamespace(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
setDefaultNamespace in interface javax.xml.stream.XMLStreamWriterjavax.xml.stream.XMLStreamException
public void setNamespaceContext(javax.xml.namespace.NamespaceContext context)
throws javax.xml.stream.XMLStreamException
setNamespaceContext in interface javax.xml.stream.XMLStreamWritercontext - the namespace context to use for this writer, may not be null
javax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLStreamWriter
public java.lang.Object getProperty(java.lang.String name)
throws java.lang.IllegalArgumentException
getProperty in interface javax.xml.stream.XMLStreamWriterjava.lang.IllegalArgumentExceptionpublic void setManager(StAXManager manager)
public void setEncoding(java.lang.String encoding)
public void writeOctets(byte[] b,
int start,
int len)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void encodeTerminationAndCurrentElement(boolean terminateAfter)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public final void initiateLowLevelWriting()
throws javax.xml.stream.XMLStreamException
LowLevelFastInfosetStreamWriterThis method must be invoked before other low level method.
initiateLowLevelWriting in interface LowLevelFastInfosetStreamWriterjavax.xml.stream.XMLStreamExceptionpublic final int getNextElementIndex()
LowLevelFastInfosetStreamWriterThis will increment the next obtained index such that:
i = w.getNextElementIndex(); j = w.getNextElementIndex(); i == j + 1;
getNextElementIndex in interface LowLevelFastInfosetStreamWriterpublic final int getNextAttributeIndex()
LowLevelFastInfosetStreamWriteri = w.getNextAttributeIndex(); j = w.getNextAttributeIndex(); i == j + 1;
getNextAttributeIndex in interface LowLevelFastInfosetStreamWriterpublic final int getLocalNameIndex()
LowLevelFastInfosetStreamWriter
getLocalNameIndex in interface LowLevelFastInfosetStreamWriterpublic final int getNextLocalNameIndex()
LowLevelFastInfosetStreamWriteri = w.getNextLocalNameIndex(); j = w.getNextLocalNameIndex(); i == j + 1;
getNextLocalNameIndex in interface LowLevelFastInfosetStreamWriter
public final void writeLowLevelTerminationAndMark()
throws java.io.IOException
writeLowLevelTerminationAndMark in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelStartElementIndexed(int type,
int index)
throws java.io.IOException
writeLowLevelStartElementIndexed in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final boolean writeLowLevelStartElement(int type,
java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
throws java.io.IOException
LowLevelFastInfosetStreamWriter
writeLowLevelStartElement in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelStartNamespaces()
throws java.io.IOException
writeLowLevelStartNamespaces in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelNamespace(java.lang.String prefix,
java.lang.String namespaceName)
throws java.io.IOException
writeLowLevelNamespace in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelEndNamespaces()
throws java.io.IOException
writeLowLevelEndNamespaces in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelStartAttributes()
throws java.io.IOException
writeLowLevelStartAttributes in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelAttributeIndexed(int index)
throws java.io.IOException
writeLowLevelAttributeIndexed in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final boolean writeLowLevelAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName)
throws java.io.IOException
LowLevelFastInfosetStreamWriter
writeLowLevelAttribute in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelAttributeValue(java.lang.String value)
throws java.io.IOException
writeLowLevelAttributeValue in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
byte[] utf8LocalName,
java.lang.String namespaceURI)
throws java.io.IOException
writeLowLevelStartNameLiteral in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
int localNameIndex,
java.lang.String namespaceURI)
throws java.io.IOException
writeLowLevelStartNameLiteral in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelEndStartElement()
throws java.io.IOException
writeLowLevelEndStartElement in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelEndElement()
throws java.io.IOException
writeLowLevelEndElement in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelText(char[] text,
int length)
throws java.io.IOException
writeLowLevelText in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelText(java.lang.String text)
throws java.io.IOException
writeLowLevelText in interface LowLevelFastInfosetStreamWriterjava.io.IOException
public final void writeLowLevelOctets(byte[] octets,
int length)
throws java.io.IOException
writeLowLevelOctets in interface LowLevelFastInfosetStreamWriterjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||