Class StreamWriterBase

java.lang.Object
org.codehaus.stax2.ri.Stax2WriterImpl
com.fasterxml.aalto.out.StreamWriterBase
All Implemented Interfaces:
NamespaceContext, XMLStreamConstants, XMLStreamWriter, org.codehaus.stax2.typed.TypedXMLStreamWriter, org.codehaus.stax2.validation.Validatable, org.codehaus.stax2.validation.ValidationContext, org.codehaus.stax2.XMLStreamWriter2
Direct Known Subclasses:
NonRepairingStreamWriter, RepairingStreamWriter

public abstract class StreamWriterBase extends org.codehaus.stax2.ri.Stax2WriterImpl implements NamespaceContext, org.codehaus.stax2.validation.ValidationContext
Base class for XMLStreamReader implementations.
  • Field Details

    • _config

      protected final WriterConfig _config
    • _rootNsContext

      protected NamespaceContext _rootNsContext
      Root namespace context defined for this writer, if any.
    • _cfgCheckStructure

      protected boolean _cfgCheckStructure
    • _cfgCheckContent

      protected boolean _cfgCheckContent
    • _cfgCheckAttrs

      protected boolean _cfgCheckAttrs
    • _cfgCDataAsText

      protected final boolean _cfgCDataAsText
    • _symbols

      protected WNameTable _symbols
    • _xmlWriter

      protected final XmlWriter _xmlWriter
      Actual physical writer to output serialized XML content to
    • _valueEncoderFactory

      protected org.codehaus.stax2.ri.typed.ValueEncoderFactory _valueEncoderFactory
      When outputting using Typed Access API, we will need encoders. If so, they will created by lazily-constructed factory
    • _validator

      protected org.codehaus.stax2.validation.XMLValidator _validator
      Optional validator to use for validating output against one or more schemas, and/or for safe pretty-printing (indentation).
    • _vldContent

      protected int _vldContent
      State value used with validation, to track types of content that is allowed at this point in output stream. Only used if validation is enabled: if so, value is determined via validation callbacks.
    • _vldProblemHandler

      protected org.codehaus.stax2.validation.ValidationProblemHandler _vldProblemHandler
      Custom validation problem handler, if any.
    • _state

      protected StreamWriterBase.State _state
    • _currElem

      protected OutputElement _currElem
      We'll use a virtual root element (like a document node of sort), to simplify other processing, basically such that there is always a current output element instance, even when in prolog or epilog.
    • _stateAnyOutput

      protected boolean _stateAnyOutput
      Flag that is set to true first time something has been output. Generally needed to keep track of whether XML declaration (START_DOCUMENT) can be output or not.
    • _stateStartElementOpen

      protected boolean _stateStartElementOpen
      Flag that is set during time that a start element is "open", ie. START_ELEMENT has been output (and possibly zero or more name space declarations and attributes), before other main-level constructs have been output.
    • _stateEmptyElement

      protected boolean _stateEmptyElement
      Flag that indicates that current element is an empty element (one that is explicitly defined as one, by calling a method -- NOT one that just happens to be empty). This is needed to know what to do when next non-ns/attr node is output; normally a new context is opened, but for empty elements not.
    • _dtdRootElemName

      protected String _dtdRootElemName
      Value passed as the expected root element, when using the multiple argument writeDTD(java.lang.String) method. Will be used in structurally validating mode (and in dtd-validating mode, since that automatically enables structural validation as well, to pre-filter well-formedness errors that validators might have trouble dealing with).
    • _outputElemPool

      protected OutputElement _outputElemPool
    • MAX_POOL_SIZE

      static final int MAX_POOL_SIZE
      Although pooled objects are small, let's limit the pool size nonetheless, to minimize extra memory usage for deeply nested documents. Even just 4 levels might be enough, 8 should cover > 95% of cases
      See Also:
    • _poolSize

      protected int _poolSize
  • Constructor Details

  • Method Details