Top Description Fields Constructors Methods
com.sun.xml.fastinfoset.stax

public Class StAXDocumentSerializer

extends Encoder
implements XMLStreamWriter, LowLevelFastInfosetStreamWriter
Class Inheritance
All Implemented Interfaces
org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter, javax.xml.stream.XMLStreamWriter
Imports
com.sun.xml.fastinfoset.Encoder, .EncodingConstants, .CommonResourceBundle, .QualifiedName, com.sun.xml.fastinfoset.util.NamespaceContextImplementation, .LocalNameQualifiedNamesMap, java.io.IOException, .OutputStream, java.util.EmptyStackException, javax.xml.namespace.NamespaceContext, javax.xml.stream.XMLStreamException, .XMLStreamWriter, org.jvnet.fastinfoset.EncodingAlgorithmIndexes, .FastInfosetException, org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter

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 java.io.OutputStream.

Field Summary

Modifier and TypeField and Description
protected String[]
_attributesArray

List of attributes qnames and values defined in the current element.

protected int
protected String
_currentLocalName

Local name of current element.

protected String
_currentPrefix

Prefix of current element.

protected String
_currentUri

Namespace of current element.

protected String
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
protected String[]
_namespacesArray

List of namespaces defined in the current element.

protected int
protected NamespaceContextImplementation
_nsContext

Mapping between uris and prefixes.

protected boolean[]
protected int
Inherited from com.sun.xml.fastinfoset.Encoder:
_b_characterEncodingSchemeSystemDefault_charBuffer_markIndex_octetBuffer_octetBufferIndex_s_terminate_v_vDataattributeValueMapTotalCharactersConstraintCHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTYcharacterContentChunkMapTotalCharactersConstraintmaxAttributeValueSizemaxCharacterContentChunkSizeminAttributeValueSizeminCharacterContentChunkSize

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.xml.stream.XMLStreamWriter.close.

Close this writer and free any resources associated with the writer.

private boolean
encodeAttribute(String namespaceURI, String prefix, String localName)

private boolean
encodeElement(int type, String namespaceURI, String prefix, String localName)

private void
encodeLiteral(int type, String namespaceURI, String prefix, String localName)

private void
encodeLiteralHeader(int type, String namespaceURI, String prefix)

protected void
encodeTerminationAndCurrentElement(boolean terminateAfter)

public void
flush()

Implements javax.xml.stream.XMLStreamWriter.flush.

Write any cached data to the underlying output mechanism.

public final int
getLocalNameIndex()

Implements org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter.getLocalNameIndex.

Get the current index that was applied to an [local name] of an Element or Attribute Information Item.

public NamespaceContext
getNamespaceContext()

Implements javax.xml.stream.XMLStreamWriter.getNamespaceContext.

Returns the current namespace context.

public final int
getNextAttributeIndex()

Implements org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter.getNextAttributeIndex.

Get the next index to apply to an Attribute Information Item.

public final int
getNextElementIndex()

Implements org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter.getNextElementIndex.

Get the next index to apply to an Element Information Item.

public final int
getNextLocalNameIndex()

Implements org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter.getNextLocalNameIndex.

Get the next index to apply to an [local name] of an Element or Attribute Information Item.

public String
getPrefix(String uri)

Implements javax.xml.stream.XMLStreamWriter.getPrefix.

Gets the prefix the uri is bound to.

public Object
getProperty(String name)

Implements javax.xml.stream.XMLStreamWriter.getProperty.

Get the value of a feature/property from the underlying implementation

public final void
public void
reset()

Overrides com.sun.xml.fastinfoset.Encoder.reset.

Implements org.jvnet.fastinfoset.FastInfosetSerializer.reset.

Reset the encoder for reuse encoding another XML infoset.

public void
setDefaultNamespace(String uri)

Implements javax.xml.stream.XMLStreamWriter.setDefaultNamespace.

Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.

public void
setEncoding(String encoding)

public void
public void
setNamespaceContext(NamespaceContext
the namespace context to use for this writer, may not be null
context
)

Implements javax.xml.stream.XMLStreamWriter.setNamespaceContext.

Sets the current namespace context for prefix and uri bindings.

public void
setPrefix(String prefix, String uri)

Implements javax.xml.stream.XMLStreamWriter.setPrefix.

Sets the prefix the uri is bound to.

public void
writeAttribute(String localName, String value)

Implements javax.xml.stream.XMLStreamWriter.writeAttribute.

Writes an attribute to the output stream without a prefix.

public void
writeAttribute(String namespaceURI, String localName, String value)

Implements javax.xml.stream.XMLStreamWriter.writeAttribute.

Writes an attribute to the output stream

public void
writeAttribute(String prefix, String namespaceURI, String localName, String value)

Implements javax.xml.stream.XMLStreamWriter.writeAttribute.

Writes an attribute to the output stream

public void
writeCData(String text)

Implements javax.xml.stream.XMLStreamWriter.writeCData.

Writes a CData section

public void
public void
writeCharacters(char[] text, int start, int len)

Implements javax.xml.stream.XMLStreamWriter.writeCharacters.

Write text to the output

public void
writeComment(String data)

Implements javax.xml.stream.XMLStreamWriter.writeComment.

Writes an xml comment with the data enclosed

public void
writeDefaultNamespace(String namespaceURI)

Implements javax.xml.stream.XMLStreamWriter.writeDefaultNamespace.

Writes the default namespace to the stream

public void
writeDTD(String dtd)

Implements javax.xml.stream.XMLStreamWriter.writeDTD.

Write a DTD section.

public void
writeEmptyElement(String localName)

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

public void
writeEmptyElement(String namespaceURI, String localName)

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

public void
writeEmptyElement(String prefix, String localName, String namespaceURI)

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

public void
writeEndDocument()

Implements javax.xml.stream.XMLStreamWriter.writeEndDocument.

Closes any start tags and writes corresponding end tags.

public void
writeEndElement()

Implements javax.xml.stream.XMLStreamWriter.writeEndElement.

Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.

public void
writeEntityRef(String name)

Implements javax.xml.stream.XMLStreamWriter.writeEntityRef.

Writes an entity reference

public final boolean
public final void
public final void
public final void
public final void
public final void
public final void
public final void
public final void
public final boolean
writeLowLevelStartElement(int type, String prefix, String localName, String namespaceURI)

Implements org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter.writeLowLevelStartElement.

Write the start of an element.

public final void
public final void
public final void
public final void
public final void
public final void
public final void
public void
writeNamespace(String prefix, String namespaceURI)

Implements javax.xml.stream.XMLStreamWriter.writeNamespace.

Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace

public void
writeOctets(byte[] b, int start, int len)

public void
public void
public void
public void
writeStartDocument(String version)

Implements javax.xml.stream.XMLStreamWriter.writeStartDocument.

Write the XML Declaration.

public void
writeStartDocument(String encoding, String version)

Implements javax.xml.stream.XMLStreamWriter.writeStartDocument.

Write the XML Declaration.

public void
writeStartElement(String localName)

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output.

public void
writeStartElement(String namespaceURI, String localName)

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output

public void
writeStartElement(String prefix, String localName, String namespaceURI)

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output

Inherited from com.sun.xml.fastinfoset.Encoder:
canAddAttributeToTablecanAddCharacterContentToTableencodeAIIBuiltInAlgorithmDataencodeAIIObjectAlgorithmDataencodeAIIOctetAlgorithmDataencodeAlphabetCharactersencodeAttributeQualifiedNameOnSecondBitencodeCharactersencodeCharactersNoCloneencodeCIIBuiltInAlgorithmDataencodeCIIBuiltInAlgorithmDataAsCDATAencodeCIIObjectAlgorithmDataencodeCIIOctetAlgorithmDataencodeCommentencodeCommentNoCloneencodeDateTimeFourBitCharactersencodeDateTimeNonIdentifyingStringOnFirstBitencodeDocumentTerminationencodeDocumentTypeDeclarationencodeElementQualifiedNameOnThirdBitencodeElementTerminationencodeFourBitCharactersencodeHeaderencodeIdentifyingNonEmptyStringOnFirstBitencodeInitialVocabularyencodeLiteralAttributeQualifiedNameOnSecondBitencodeLiteralElementQualifiedNameOnThirdBitencodeNamespaceAttributeencodeNonEmptyCharacterStringOnFifthBitencodeNonEmptyCharacterStringOnFifthBitencodeNonEmptyCharacterStringOnSeventhBitencodeNonEmptyFourBitCharacterStringencodeNonEmptyFourBitCharacterStringOnSeventhBitencodeNonEmptyNBitCharacterStringOnSeventhBitencodeNonEmptyOctetStringOnSecondBitencodeNonEmptyUTF8StringAsOctetStringencodeNonEmptyUTF8StringAsOctetStringencodeNonIdentifyingStringOnFirstBitencodeNonIdentifyingStringOnFirstBitencodeNonIdentifyingStringOnFirstBitencodeNonIdentifyingStringOnFirstBitencodeNonIdentifyingStringOnFirstBitencodeNonIdentifyingStringOnThirdBitencodeNonIdentifyingStringOnThirdBitencodeNonIdentifyingStringOnThirdBitencodeNonZeroIntegerencodeNonZeroIntegerOnFourthBitencodeNonZeroIntegerOnSecondBitFirstBitOneencodeNonZeroIntegerOnSecondBitFirstBitZeroencodeNonZeroIntegerOnThirdBitencodeNonZeroOctetStringLengthencodeNonZeroOctetStringLengthOnFifthBitencodeNonZeroOctetStringLengthOnSecondBitencodeNonZeroOctetStringLengthOnSenventhBitencodeNumericFourBitCharactersencodeNumericNonIdentifyingStringOnFirstBitencodeProcessingInstructionencodeTerminationencodeUtf16StringencodeUtf16StringencodeUTF8StringencodeUTF8StringgetAttributeValueMapMemoryLimitgetCharacterContentChunkMapMemoryLimitgetCharacterEncodingSchemegetIgnoreCommentsgetIgnoreDTDgetIgnoreProcesingInstructionsgetIgnoreWhiteSpaceTextContentgetMaxAttributeValueSizegetMaxCharacterContentChunkSizegetMinAttributeValueSizegetMinCharacterContentChunkSizegetPrefixFromQualifiedNamegetRegisteredEncodingAlgorithmsgetVocabularyApplicationDatahasMarkisAttributeValueLengthMatchesLimitisCharacterContentChunkLengthMatchesLimitisWhiteSpaceisWhiteSpacemarkresetMarksetAttributeValueMapMemoryLimitsetCharacterContentChunkMapMemoryLimitsetCharacterEncodingSchemesetExternalVocabularysetIgnoreCommentssetIgnoreDTDsetIgnoreProcesingInstructionssetIgnoreWhiteSpaceTextContentsetMaxAttributeValueSizesetMaxCharacterContentChunkSizesetMinAttributeValueSizesetMinCharacterContentChunkSizesetOutputStreamsetRegisteredEncodingAlgorithmssetVocabularysetVocabularyApplicationDatawritewritewrite