|
||||||||||
| 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 String[] |
_attributesArray
List of attributes qnames and values defined in the current element. |
protected int |
_attributesArrayIndex
|
protected String |
_currentLocalName
Local name of current element. |
protected String |
_currentPrefix
Prefix of current element. |
protected String |
_currentUri
Namespace of current element. |
protected 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 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(OutputStream outputStream)
|
|
StAXDocumentSerializer(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. |
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. |
String |
getPrefix(String uri)
|
Object |
getProperty(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(String uri)
|
void |
setEncoding(String encoding)
|
void |
setManager(StAXManager manager)
|
void |
setNamespaceContext(NamespaceContext context)
Sets the current namespace context for prefix and uri bindings. |
void |
setPrefix(String prefix,
String uri)
|
void |
writeAttribute(String localName,
String value)
|
void |
writeAttribute(String namespaceURI,
String localName,
String value)
|
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
String value)
|
void |
writeCData(String text)
|
void |
writeCharacters(char[] text,
int start,
int len)
|
void |
writeCharacters(String text)
|
void |
writeComment(String data)
|
void |
writeDefaultNamespace(String namespaceURI)
|
void |
writeDTD(String dtd)
|
void |
writeEmptyElement(String localName)
|
void |
writeEmptyElement(String namespaceURI,
String localName)
|
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI)
|
void |
writeEndDocument()
|
void |
writeEndElement()
|
void |
writeEntityRef(String name)
|
boolean |
writeLowLevelAttribute(String prefix,
String namespaceURI,
String localName)
Write an attribute. |
void |
writeLowLevelAttributeIndexed(int index)
|
void |
writeLowLevelAttributeValue(String value)
|
void |
writeLowLevelEndElement()
|
void |
writeLowLevelEndNamespaces()
|
void |
writeLowLevelEndStartElement()
|
void |
writeLowLevelNamespace(String prefix,
String namespaceName)
|
void |
writeLowLevelOctets(byte[] octets,
int length)
|
void |
writeLowLevelStartAttributes()
|
boolean |
writeLowLevelStartElement(int type,
String prefix,
String localName,
String namespaceURI)
Write the start of an element. |
void |
writeLowLevelStartElementIndexed(int type,
int index)
|
void |
writeLowLevelStartNameLiteral(int type,
String prefix,
byte[] utf8LocalName,
String namespaceURI)
|
void |
writeLowLevelStartNameLiteral(int type,
String prefix,
int localNameIndex,
String namespaceURI)
|
void |
writeLowLevelStartNamespaces()
|
void |
writeLowLevelTerminationAndMark()
|
void |
writeLowLevelText(char[] text,
int length)
|
void |
writeLowLevelText(String text)
|
void |
writeNamespace(String prefix,
String namespaceURI)
|
void |
writeOctets(byte[] b,
int start,
int len)
|
void |
writeProcessingInstruction(String target)
|
void |
writeProcessingInstruction(String target,
String data)
|
void |
writeStartDocument()
|
void |
writeStartDocument(String version)
|
void |
writeStartDocument(String encoding,
String version)
|
void |
writeStartElement(String localName)
|
void |
writeStartElement(String namespaceURI,
String localName)
|
void |
writeStartElement(String prefix,
String localName,
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 String _encoding
protected String _currentLocalName
protected String _currentUri
protected String _currentPrefix
protected boolean _inStartElement
protected boolean _isEmptyElement
protected String[] _attributesArray
protected int _attributesArrayIndex
protected boolean[] _nsSupportContextStack
protected int _stackCount
protected NamespaceContextImplementation _nsContext
protected String[] _namespacesArray
protected int _namespacesArrayIndex
| Constructor Detail |
|---|
public StAXDocumentSerializer()
public StAXDocumentSerializer(OutputStream outputStream)
public StAXDocumentSerializer(OutputStream outputStream,
StAXManager manager)
| Method Detail |
|---|
public void reset()
Encoder
reset in interface FastInfosetSerializerreset in class Encoder
public void writeStartDocument()
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeStartDocument(String version)
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeStartDocument(String encoding,
String version)
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamException
public void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamException
public void flush()
throws XMLStreamException
flush in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String localName)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String namespaceURI,
String localName)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String localName)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String namespaceURI,
String localName)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String namespaceURI,
String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String prefix,
String namespaceURI,
String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeNamespace(String prefix,
String namespaceURI)
throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamException
public void writeDefaultNamespace(String namespaceURI)
throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamException
public void writeComment(String data)
throws XMLStreamException
writeComment in interface XMLStreamWriterXMLStreamException
public void writeProcessingInstruction(String target)
throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamException
public void writeProcessingInstruction(String target,
String data)
throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamException
public void writeCData(String text)
throws XMLStreamException
writeCData in interface XMLStreamWriterXMLStreamException
public void writeDTD(String dtd)
throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamException
public void writeEntityRef(String name)
throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamException
public void writeCharacters(String text)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamException
public void writeCharacters(char[] text,
int start,
int len)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamException
public String getPrefix(String uri)
throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamException
public void setPrefix(String prefix,
String uri)
throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamException
public void setDefaultNamespace(String uri)
throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamException
public void setNamespaceContext(NamespaceContext context)
throws XMLStreamException
setNamespaceContext in interface XMLStreamWritercontext - the namespace context to use for this writer, may not be null
XMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWriter
public Object getProperty(String name)
throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentExceptionpublic void setManager(StAXManager manager)
public void setEncoding(String encoding)
public void writeOctets(byte[] b,
int start,
int len)
throws XMLStreamException
XMLStreamException
protected void encodeTerminationAndCurrentElement(boolean terminateAfter)
throws XMLStreamException
XMLStreamException
public final void initiateLowLevelWriting()
throws XMLStreamException
LowLevelFastInfosetStreamWriterThis method must be invoked before other low level method.
initiateLowLevelWriting in interface LowLevelFastInfosetStreamWriterXMLStreamExceptionpublic 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 IOException
writeLowLevelTerminationAndMark in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelStartElementIndexed(int type,
int index)
throws IOException
writeLowLevelStartElementIndexed in interface LowLevelFastInfosetStreamWriterIOException
public final boolean writeLowLevelStartElement(int type,
String prefix,
String localName,
String namespaceURI)
throws IOException
LowLevelFastInfosetStreamWriter
writeLowLevelStartElement in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelStartNamespaces()
throws IOException
writeLowLevelStartNamespaces in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelNamespace(String prefix,
String namespaceName)
throws IOException
writeLowLevelNamespace in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelEndNamespaces()
throws IOException
writeLowLevelEndNamespaces in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelStartAttributes()
throws IOException
writeLowLevelStartAttributes in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelAttributeIndexed(int index)
throws IOException
writeLowLevelAttributeIndexed in interface LowLevelFastInfosetStreamWriterIOException
public final boolean writeLowLevelAttribute(String prefix,
String namespaceURI,
String localName)
throws IOException
LowLevelFastInfosetStreamWriter
writeLowLevelAttribute in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelAttributeValue(String value)
throws IOException
writeLowLevelAttributeValue in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelStartNameLiteral(int type,
String prefix,
byte[] utf8LocalName,
String namespaceURI)
throws IOException
writeLowLevelStartNameLiteral in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelStartNameLiteral(int type,
String prefix,
int localNameIndex,
String namespaceURI)
throws IOException
writeLowLevelStartNameLiteral in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelEndStartElement()
throws IOException
writeLowLevelEndStartElement in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelEndElement()
throws IOException
writeLowLevelEndElement in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelText(char[] text,
int length)
throws IOException
writeLowLevelText in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelText(String text)
throws IOException
writeLowLevelText in interface LowLevelFastInfosetStreamWriterIOException
public final void writeLowLevelOctets(byte[] octets,
int length)
throws IOException
writeLowLevelOctets in interface LowLevelFastInfosetStreamWriterIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||