Class WstxEventReader

java.lang.Object
com.ctc.wstx.evt.WstxEventReader
All Implemented Interfaces:
Iterator, XMLEventReader, XMLStreamConstants, org.codehaus.stax2.XMLEventReader2

public class WstxEventReader extends Object implements org.codehaus.stax2.XMLEventReader2, XMLStreamConstants
Woodstox version of XMLEventReader2 (and XMLEventReader).

NOTE: up to Woodstox 5.1, this was based on Stax2 Reference Implementation (Stax2EventReaderImpl), but due to various issues has temporarily (?) been cut-paste-modified here. Ideally it would be reconciled once Stax2-api version 4.2 can be relied as baseline, but that may take time.

  • Field Details

    • STATE_INITIAL

      protected static final int STATE_INITIAL
      See Also:
    • STATE_END_OF_INPUT

      protected static final int STATE_END_OF_INPUT
      See Also:
    • STATE_CONTENT

      protected static final int STATE_CONTENT
      See Also:
    • ERR_GETELEMTEXT_NOT_START_ELEM

      protected static final int ERR_GETELEMTEXT_NOT_START_ELEM
      Current state when getElementText() called not START_ELEMENT
      See Also:
    • ERR_GETELEMTEXT_NON_TEXT_EVENT

      protected static final int ERR_GETELEMTEXT_NON_TEXT_EVENT
      Encountered non-textual event (other than closing END_ELEMENT) when collecting text for getElementText()
      See Also:
    • ERR_NEXTTAG_NON_WS_TEXT

      protected static final int ERR_NEXTTAG_NON_WS_TEXT
      Encountered CHARACTERS or CDATA that contains non-white space char(s), when trying to locate tag with nextTag()
      See Also:
    • ERR_NEXTTAG_WRONG_TYPE

      protected static final int ERR_NEXTTAG_WRONG_TYPE
      Encountered non-skippable non-text/element event with nextTag()
      See Also:
    • mAllocator

      protected final XMLEventAllocator mAllocator
    • mReader

      protected final org.codehaus.stax2.XMLStreamReader2 mReader
    • mPeekedEvent

      protected XMLEvent mPeekedEvent
      Event that has been peeked, ie. loaded without call to nextEvent(); will be returned and cleared by call to nextEvent() (or, returned again if peeked again)
    • mState

      protected int mState
      High-level state indicator, with currently three values: whether we are initializing (need to synthetize START_DOCUMENT), at END_OF_INPUT (end-of-doc), or otherwise, normal operation. Useful in simplifying some methods, as well as to make sure that independent of how stream reader handles things, event reader can reliably detect End-Of-Document.
    • mPrePeekEvent

      protected int mPrePeekEvent
      This variable keeps track of the type of the 'previous' event when peeking for the next Event. It is needed for some functionality, to remember state even when underlying parser has to move to peek the next event.
    • mCfgMultiDocMode

      protected final boolean mCfgMultiDocMode
      Marker flag to allow specialized handling in "multi-document" reading mode.
  • Constructor Details

    • WstxEventReader

      public WstxEventReader(XMLEventAllocator a, org.codehaus.stax2.XMLStreamReader2 r)
  • Method Details