Class FastInfosetWriter

java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.sun.xml.fastinfoset.Encoder
com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
com.sun.xml.rpc.streaming.FastInfosetWriter
All Implemented Interfaces:
XMLWriter, XMLStreamWriter, org.jvnet.fastinfoset.FastInfosetSerializer, org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class FastInfosetWriter extends com.sun.xml.fastinfoset.stax.StAXDocumentSerializer implements XMLWriter
  • Field Summary

    Fields inherited from class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer

    _attributesArray, _attributesArrayIndex, _currentLocalName, _currentPrefix, _currentUri, _encoding, _inStartElement, _isEmptyElement, _manager, _namespacesArray, _namespacesArrayIndex, _nsContext, _nsSupportContextStack, _stackCount

    Fields inherited from class com.sun.xml.fastinfoset.Encoder

    _b, _characterEncodingSchemeSystemDefault, _charBuffer, _markIndex, _octetBuffer, _octetBufferIndex, _s, _terminate, _v, _vData, attributeValueMapTotalCharactersConstraint, CHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTY, characterContentChunkMapTotalCharactersConstraint, maxAttributeValueSize, maxCharacterContentChunkSize, minAttributeValueSize, minCharacterContentChunkSize

    Fields inherited from interface org.jvnet.fastinfoset.FastInfosetSerializer

    ATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT, BUFFER_SIZE_PROPERTY, CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT, EXTERNAL_VOCABULARIES_PROPERTY, IGNORE_COMMENTS_FEATURE, IGNORE_DTD_FEATURE, IGNORE_PROCESSING_INSTRUCTIONS_FEATURE, IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE, MAX_ATTRIBUTE_VALUE_SIZE, MAX_CHARACTER_CONTENT_CHUNK_SIZE, MIN_ATTRIBUTE_VALUE_SIZE, MIN_CHARACTER_CONTENT_CHUNK_SIZE, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, UTF_16BE, UTF_8
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the writer and its underlying stream.
    void
    Write the end tag for the current element.
    void
    Flush the writer and its underlying stream.
    Return a prefix for the given URI.
    Return the prefix factory in use by this writer.
    getURI(String prefix)
    Return the URI for a given prefix.
    void
     
    void
    Set the prefix factory to be used by this writer.
    void
    startElement(String localName)
    Write the start tag for an element.
    void
    startElement(String localName, String uri)
    Write the start tag for an element.
    void
    startElement(String localName, String uri, String prefix)
    Write the start tag for an element.
    void
    Write the start tag for an element.
    void
    startElement(QName name, String prefix)
    Write the start tag for an element.
    void
    writeAttribute(String localName, String value)
    Write an attribute of the current element.
    void
    writeAttribute(String localName, String uri, String value)
    Write an attribute of the current element.
    void
    writeAttribute(QName name, String value)
    Write an attribute of the current element.
    void
    Write an attribute (unquoted) of the current element.
    void
    writeAttributeUnquoted(String localName, String uri, String value)
    Write an attribute (unquoted) of the current element.
    void
    Write an attribute (unquoted) of the current element.
    final void
    writeBytes(byte[] b, int start, int length)
    Backdoor method to encode bytes using the base64 built-in algorithm that FI supports.
    void
    Write character data within an element.
    void
    Write character data within an element.
    void
    writeCharsUnquoted(char[] buf, int offset, int len)
    Write character data within an element, skipping quoting.
    void
    Write character data within an element, skipping quoting.
    void
    Write a comment within an element.
    void
    Write a namespace declaration of the current element.
    void
    Write a namespace declaration of the current element.
    void
     

    Methods inherited from class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer

    encodeTerminationAndCurrentElement, getLocalNameIndex, getNamespaceContext, getNextAttributeIndex, getNextElementIndex, getNextLocalNameIndex, getProperty, initiateLowLevelWriting, setDefaultNamespace, setEncoding, setManager, setNamespaceContext, setPrefix, writeAttribute, writeCData, writeCharacters, writeCharacters, writeDefaultNamespace, writeDTD, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEndElement, writeEntityRef, writeLowLevelAttribute, writeLowLevelAttributeIndexed, writeLowLevelAttributeValue, writeLowLevelEndElement, writeLowLevelEndNamespaces, writeLowLevelEndStartElement, writeLowLevelNamespace, writeLowLevelOctets, writeLowLevelStartAttributes, writeLowLevelStartElement, writeLowLevelStartElementIndexed, writeLowLevelStartNameLiteral, writeLowLevelStartNameLiteral, writeLowLevelStartNamespaces, writeLowLevelTerminationAndMark, writeLowLevelText, writeLowLevelText, writeNamespace, writeOctets, writeProcessingInstruction, writeProcessingInstruction, writeStartDocument, writeStartDocument, writeStartElement, writeStartElement, writeStartElement

    Methods inherited from class com.sun.xml.fastinfoset.Encoder

    canAddAttributeToTable, canAddCharacterContentToTable, encodeAIIBuiltInAlgorithmData, encodeAIIObjectAlgorithmData, encodeAIIOctetAlgorithmData, encodeAlphabetCharacters, encodeAttributeQualifiedNameOnSecondBit, encodeCharacters, encodeCharactersNoClone, encodeCIIBuiltInAlgorithmData, encodeCIIBuiltInAlgorithmDataAsCDATA, encodeCIIObjectAlgorithmData, encodeCIIOctetAlgorithmData, encodeComment, encodeCommentNoClone, encodeDateTimeFourBitCharacters, encodeDateTimeNonIdentifyingStringOnFirstBit, encodeDocumentTermination, encodeDocumentTypeDeclaration, encodeElementQualifiedNameOnThirdBit, encodeElementTermination, encodeFourBitCharacters, encodeHeader, encodeIdentifyingNonEmptyStringOnFirstBit, encodeInitialVocabulary, encodeLiteralAttributeQualifiedNameOnSecondBit, encodeLiteralElementQualifiedNameOnThirdBit, encodeNamespaceAttribute, encodeNonEmptyCharacterStringOnFifthBit, encodeNonEmptyCharacterStringOnFifthBit, encodeNonEmptyCharacterStringOnSeventhBit, encodeNonEmptyFourBitCharacterString, encodeNonEmptyFourBitCharacterStringOnSeventhBit, encodeNonEmptyNBitCharacterStringOnSeventhBit, encodeNonEmptyOctetStringOnSecondBit, encodeNonEmptyUTF8StringAsOctetString, encodeNonEmptyUTF8StringAsOctetString, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnThirdBit, encodeNonIdentifyingStringOnThirdBit, encodeNonIdentifyingStringOnThirdBit, encodeNonZeroInteger, encodeNonZeroIntegerOnFourthBit, encodeNonZeroIntegerOnSecondBitFirstBitOne, encodeNonZeroIntegerOnSecondBitFirstBitZero, encodeNonZeroIntegerOnThirdBit, encodeNonZeroOctetStringLength, encodeNonZeroOctetStringLengthOnFifthBit, encodeNonZeroOctetStringLengthOnSecondBit, encodeNonZeroOctetStringLengthOnSenventhBit, encodeNumericFourBitCharacters, encodeNumericNonIdentifyingStringOnFirstBit, encodeProcessingInstruction, encodeTermination, encodeUtf16String, encodeUtf16String, encodeUTF8String, encodeUTF8String, getAttributeValueMapMemoryLimit, getCharacterContentChunkMapMemoryLimit, getCharacterEncodingScheme, getIgnoreComments, getIgnoreDTD, getIgnoreProcesingInstructions, getIgnoreWhiteSpaceTextContent, getMaxAttributeValueSize, getMaxCharacterContentChunkSize, getMinAttributeValueSize, getMinCharacterContentChunkSize, getPrefixFromQualifiedName, getRegisteredEncodingAlgorithms, getVocabularyApplicationData, hasMark, isAttributeValueLengthMatchesLimit, isCharacterContentChunkLengthMatchesLimit, isWhiteSpace, isWhiteSpace, mark, resetMark, setAttributeValueMapMemoryLimit, setCharacterContentChunkMapMemoryLimit, setCharacterEncodingScheme, setExternalVocabulary, setIgnoreComments, setIgnoreDTD, setIgnoreProcesingInstructions, setIgnoreWhiteSpaceTextContent, setMaxAttributeValueSize, setMaxCharacterContentChunkSize, setMinAttributeValueSize, setMinCharacterContentChunkSize, setOutputStream, setRegisteredEncodingAlgorithms, setVocabulary, setVocabularyApplicationData, write, write, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • reset

      public void reset()
      Specified by:
      reset in interface org.jvnet.fastinfoset.FastInfosetSerializer
      Overrides:
      reset in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • writeStartDocument

      public void writeStartDocument()
      Specified by:
      writeStartDocument in interface XMLStreamWriter
      Overrides:
      writeStartDocument in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • writeAttribute

      public void writeAttribute(String localName, String value)
      Description copied from interface: XMLWriter
      Write an attribute of the current element.
      Specified by:
      writeAttribute in interface XMLStreamWriter
      Specified by:
      writeAttribute in interface XMLWriter
      Overrides:
      writeAttribute in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • startElement

      public void startElement(QName name)
      Description copied from interface: XMLWriter
      Write the start tag for an element.
      Specified by:
      startElement in interface XMLWriter
    • startElement

      public void startElement(String localName)
      Description copied from interface: XMLWriter
      Write the start tag for an element.
      Specified by:
      startElement in interface XMLWriter
    • startElement

      public void startElement(String localName, String uri)
      Write the start tag for an element.
      Specified by:
      startElement in interface XMLWriter
    • startElement

      public void startElement(String localName, String uri, String prefix)
      Write the start tag for an element.
      Specified by:
      startElement in interface XMLWriter
    • writeAttribute

      public void writeAttribute(String localName, String uri, String value)
      Write an attribute of the current element.
      Specified by:
      writeAttribute in interface XMLStreamWriter
      Specified by:
      writeAttribute in interface XMLWriter
      Overrides:
      writeAttribute in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • startElement

      public void startElement(QName name, String prefix)
      Description copied from interface: XMLWriter
      Write the start tag for an element.
      Specified by:
      startElement in interface XMLWriter
    • writeAttribute

      public void writeAttribute(QName name, String value)
      Description copied from interface: XMLWriter
      Write an attribute of the current element.
      Specified by:
      writeAttribute in interface XMLWriter
    • writeAttributeUnquoted

      public void writeAttributeUnquoted(String localName, String value)
      Write an attribute (unquoted) of the current element.
      Specified by:
      writeAttributeUnquoted in interface XMLWriter
    • writeAttributeUnquoted

      public void writeAttributeUnquoted(String localName, String uri, String value)
      Write an attribute (unquoted) of the current element.
      Specified by:
      writeAttributeUnquoted in interface XMLWriter
    • writeAttributeUnquoted

      public void writeAttributeUnquoted(QName name, String value)
      Description copied from interface: XMLWriter
      Write an attribute (unquoted) of the current element.
      Specified by:
      writeAttributeUnquoted in interface XMLWriter
    • writeNamespaceDeclaration

      public void writeNamespaceDeclaration(String prefix, String uri)
      Write a namespace declaration of the current element.
      Specified by:
      writeNamespaceDeclaration in interface XMLWriter
    • writeNamespaceDeclaration

      public void writeNamespaceDeclaration(String uri)
      Write a namespace declaration of the current element. The prefix name will be generated by the PrefixFactory currently configured for this writer.
      Specified by:
      writeNamespaceDeclaration in interface XMLWriter
    • writeChars

      public void writeChars(String chars)
      Write character data within an element.
      Specified by:
      writeChars in interface XMLWriter
    • writeChars

      public void writeChars(CDATA chars)
      Write character data within an element.
      Specified by:
      writeChars in interface XMLWriter
    • writeCharsUnquoted

      public void writeCharsUnquoted(String chars)
      Write character data within an element, skipping quoting.
      Specified by:
      writeCharsUnquoted in interface XMLWriter
    • writeCharsUnquoted

      public void writeCharsUnquoted(char[] buf, int offset, int len)
      Write character data within an element, skipping quoting.
      Specified by:
      writeCharsUnquoted in interface XMLWriter
    • writeComment

      public void writeComment(String comment)
      Write a comment within an element.
      Specified by:
      writeComment in interface XMLStreamWriter
      Specified by:
      writeComment in interface XMLWriter
      Overrides:
      writeComment in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • endElement

      public void endElement()
      Write the end tag for the current element.
      Specified by:
      endElement in interface XMLWriter
    • getPrefixFactory

      public PrefixFactory getPrefixFactory()
      Return the prefix factory in use by this writer.
      Specified by:
      getPrefixFactory in interface XMLWriter
    • setPrefixFactory

      public void setPrefixFactory(PrefixFactory factory)
      Set the prefix factory to be used by this writer.
      Specified by:
      setPrefixFactory in interface XMLWriter
    • getURI

      public String getURI(String prefix)
      Return the URI for a given prefix. If the prefix is undeclared, return null.
      Specified by:
      getURI in interface XMLWriter
    • getPrefix

      public String getPrefix(String uri)
      Return a prefix for the given URI.

      If no prefix for the given URI is in scope, return null.

      Specified by:
      getPrefix in interface XMLStreamWriter
      Specified by:
      getPrefix in interface XMLWriter
      Overrides:
      getPrefix in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • flush

      public void flush()
      Flush the writer and its underlying stream.
      Specified by:
      flush in interface XMLStreamWriter
      Specified by:
      flush in interface XMLWriter
      Overrides:
      flush in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • close

      public void close()
      Close the writer and its underlying stream.
      Specified by:
      close in interface XMLStreamWriter
      Specified by:
      close in interface XMLWriter
      Overrides:
      close in class com.sun.xml.fastinfoset.stax.StAXDocumentSerializer
    • writeBytes

      public final void writeBytes(byte[] b, int start, int length)
      Backdoor method to encode bytes using the base64 built-in algorithm that FI supports.