XMLStreamReader2 consisting of
all functionality other than DTD-validation-specific parts, and
Typed Access API (Stax2 v3.0), which are implemented at
sub-classes.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| protected static final int | |
| protected static final int | MASK_GET_TEXT
This mask covers all types for which basic |
| protected static final int | MASK_GET_TEXT_WITH_WRITER
This mask is used with Stax2 getText() method (one that takes Writer as an argument): accepts even wider range of event types. |
| protected static final int | MASK_GET_TEXT_XXX
This mask covers all types for which extends |
| protected final AttributeCollector | mAttrCollector
Object that stores information about currently accessible attributes. |
| protected final boolean | |
| protected final boolean | |
| protected final boolean | |
| protected int | mCheckIndentation
Counter used for determining whether we are to try to heuristically "intern" white space that seems to be used for indentation purposes |
| protected final int | mConfigFlags
Set of locally stored configuration flags |
| protected int | mCurrTextLength
Sized of currentTextLength for CDATA, CHARACTERS, WHITESPACE. |
| protected int | mCurrToken
Current state of the stream, ie token value returned by
|
| protected int | mDocStandalone
Status about "stand-aloneness" of document; set to 'yes'/'no'/'unknown' based on whether there was xml declaration, and if so, whether it had standalone attribute. |
| protected String | mDtdPublicId
Public id of the DTD, if one exists and has been parsed. |
| protected String | mDtdSystemId
System id of the DTD, if one exists and has been parsed. |
| protected final InputElementStack | mElementStack
Currently open element tree |
| protected Map | mGeneralEntities
Entities parsed from internal/external DTD subsets. |
| protected final ReaderCreator | mOwner
Object to notify about shared stuff, such as symbol tables, as well as to query for additional config settings if necessary. |
| protected int | mParseState
Main parsing/tokenization state (STATE_xxx) |
| protected XMLStreamException | mPendingException
Due to the way Stax API does not allow throwing stream exceptions
from many methods for which Woodstox would need to throw one
(especially |
| protected boolean | mReturnNullForDefaultNamespace
Configuration from |
| protected String | mRootLName
Local name of root element, as dictated by DOCTYPE declaration; null if no DOCTYPE declaration. |
| protected String | mRootPrefix
Prefix of root element, as dictated by DOCTYPE declaration; null if no DOCTYPE declaration, or no root prefix |
| protected int | mSecondaryToken
Additional information sometimes stored (when generating dummy
events in multi-doc mode, for example) temporarily when
|
| protected final int | mShortestTextSegment
Minimum number of characters parser can return as partial text segment, IF it's not required to coalesce adjacent text segments. |
| protected boolean | |
| protected boolean | |
| protected final int | mStTextThreshold
Threshold value that defines tokenization state that needs to be achieved to "finish" current logical text segment (which may consist of adjacent CDATA and text segments; or be a complete physical segment; or just even a fragment of such a segment) |
| protected final TextBuffer | mTextBuffer
TextBuffer mostly used to collect non-element textual content (text, CDATA, comment content, pi data) |
| protected int | mTokenState
State of the current token; one of M_ - constants from above. |
| protected boolean | mValidateText
Flag that indicates that textual content (CDATA, CHARACTERS) is to be validated within current element's scope. |
| protected int | mVldContent
Mode information needed at this level; mostly to check what kind of textual content (if any) is allowed in current element context. |
| protected int | mWsStatus
Status of current (text) token's "whitespaceness", that is, whether it is or is not all white space. |
| protected static final String | |
| protected static final String | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| protected | BasicStreamReader(InputBootstrapper bs, BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputElementStack
Input element stack to use; if null, will create
instance locally. elemStack, boolean Override indicator; if true, this stream reader will be
used by an event reader, and should modify some of the base config
settings appropriately. If false, configuration settings are to
be used as is. forER)
|
| Modifier and Type | Method and Description |
|---|---|
| private final char[] | |
| protected TypedXMLStreamException | |
| protected XMLStreamException | |
| private final char[] | |
| private final int | |
| protected void | |
| private boolean | Returns: True, if we hit the end marker; false if not.Method that will check, given the starting ']', whether there is ending ']]>' (including optional extra ']'s); if so, will updated output buffer with extra ]s, if not, will make sure input and output are positioned for further checking. |
| protected String | Returns: Null, if keyword matches ok; String that contains erroneous keyword if not.
|
| public void | close()
Implements javax. Note as per StAX 1.0 specs, this method does NOT close the underlying input reader. |
| public void | closeCompletely()
Implements org. Method similar to
|
| private int | Returns: Event following end tag of the root elemennt, if any; END_DOCUMENT otherwis.eMethod called when advancing stream past the end tag that closes the root element of the open document. |
| protected static InputElementStack | |
| protected void | |
| protected EntityDecl | findEntity(String
Identifier of the entity to find id, Object Optional argument passed from caller; needed by DTD
reader. arg)Implements abstract com. Abstract method for sub-classes to implement, for finding a declared general or parsed entity. |
| protected void | finishDTD(boolean
If true, will copy contents of the internal
subset of DOCTYPE declaration
in the text buffer; if false, will just completely ignore the
subset (if one found). copyContents)This method gets called to handle remainder of DOCTYPE declaration, essentially the optional internal subset. |
| protected void | finishToken(boolean
Flag to enable storing an exception to a
variable, instead of immediately throwing it. If true, will
just store the exception; if false, will not store, just throw. deferErrors)Method called to read in contents of the token completely, if not yet read. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public AttributeCollector | getAttributeCollector()
Implements com. Method needed by classes (like stream writer implementations) that want to have efficient direct access to attribute collector Object, for optimal attribute name and value access. |
| public int | getAttributeCount()
Implements javax. Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE. |
| public AttributeInfo | getAttributeInfo()
Implements org. Method that can be called to get additional information about attributes related to the current start element, as well as related DTD-based information if available. |
| public String | getAttributeLocalName(int
the position of the attribute index)Implements javax. Returns the localName of the attribute at the provided index |
| public QName | getAttributeName(int
the position of the attribute index)Implements javax. Returns the qname of the attribute at the provided index |
| public String | getAttributeNamespace(int
the position of the attribute index)Implements javax. Returns the namespace of the attribute at the provided index |
| public String | getAttributePrefix(int
the position of the attribute index)Implements javax. Returns the prefix of this attribute at the provided index |
| public String | getAttributeType(int
the position of the attribute index)Implements javax. Returns the XML type of the attribute at the provided index |
| public String | getAttributeValue(int
the position of the attribute index)Implements javax. Returns the value of the attribute at the index |
| public String | getAttributeValue(String
the namespace of the attribute nsURI, String the local name of the attribute, cannot be null localName)Implements javax. Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality |
| public String | getCharacterEncodingScheme()
Implements javax. As per Stax (1.0) specs, needs to return whatever xml declaration claimed encoding is, if any; or null if no xml declaration found. |
| public EntityDecl | |
| public int | Returns: Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.Implements org. Method that returns the number of open elements in the stack; 0 when the reader is in prolog/epilog, 1 inside root element (including when pointing at the root element itself) and so on. |
| public DTDInfo | getDTDInfo()
Implements org. Since this class implements |
| public String | Returns: Internal subset portion of the DOCTYPE declaration, if any; empty String if noneImplements org.
|
| private char[] | |
| public String | |
| public String | |
| public String | |
| public String | getElementText()
Implements javax. From StAX specs: Reads the content of a text-only element, an exception is thrown if this is not a text-only element. Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content. Precondition: the current event is START_ELEMENT. Postcondition: the current event is the corresponding END_ELEMENT. |
| public String | getEncoding()
Implements javax. As per Stax (1.0) specs, needs to return whatever parser determined the encoding was, if it was able to figure it out. |
| public long | getEndingByteOffset()
Implements org. Method that can be used to get exact byte offset (number of bytes read from the stream right before getting to this location) in the stream that is pointed to by this reader, right after the end of the current event. |
| public long | getEndingCharOffset()
Implements org. Method that can be used to get exact character offset (number of chars read from the stream right before getting to this location) in the stream that is pointed to by this reader, right after the end of the current event. |
| public final XMLStreamLocation2 | getEndLocation()
Implements org. An optional method that either returns the location object that points the ending position of the current event, or null if implementation does not keep track of it (some may return only start location; and some no location at all). |
| public int | getEventType()
Implements javax. Returns type of the last event returned; or START_DOCUMENT before any events has been explicitly returned. |
| public Object | getFeature(String
Name of the feature of which value to get name)Implements org.
Deprecated
Method that can be used to get per-reader values; both generic ones (names for which are defined as constants in this class), and implementation dependant ones. |
| public InputElementStack | getInputElementStack()
Implements com. Method needed by classes (like stream writer implementations) that want to have efficient direct access to element stack implementation |
| public String | getLocalName()
Implements javax. Returns the (local) name of the current event. |
| public final Location | getLocation()
Implements abstract com. Implements javax. Return the current location of the processor. |
| public final LocationInfo | getLocationInfo()
Implements org. Location information is always accessible, for this reader. |
| public QName | getName()
Implements javax. Returns a QName for the current START_ELEMENT or END_ELEMENT event |
| public NamespaceContext | getNamespaceContext()
Implements javax. Returns a read only namespace context for the current position. |
| public int | getNamespaceCount()
Implements javax. Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. |
| public String | getNamespacePrefix(int
the position of the namespace declaration index)Implements javax. Returns the prefix for the namespace declared at the index. |
| public String | getNamespaceURI()
Implements javax. If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace. |
| public String | getNamespaceURI(int
the position of the namespace declaration index)Implements javax. Returns the uri for the namespace declared at the index. |
| public String | getNamespaceURI(String
The prefix to lookup, may not be null prefix)Implements javax. Return the uri for the given prefix. |
| public NamespaceContext | getNonTransientNamespaceContext()
Implements org. This method returns a namespace context object that contains
information identical to that returned by
|
| public String | getPIData()
Implements javax. Get the data section of a processing instruction |
| public String | getPITarget()
Implements javax. Get the target of a processing instruction |
| public String | getPrefix()
Implements javax. Returns the prefix of the current event or null if the event does not have a prefix |
| public String | getPrefixedName()
Implements org. This method returns "prefix-qualified" name of the current element. |
| public Object | getProcessedDTD()
Implements org. Note DTD-handling sub-classes need to override this method. |
| public DTDValidationSchema | getProcessedDTDSchema()
Implements org. Sub-class will override this method |
| public Object | getProperty(String
The name of the property, may not be null name)Implements javax. Get the value of a feature/property from the underlying implementation |
| public long | getStartingByteOffset()
Implements org. Method that can be used to get exact byte offset (number of bytes read from the stream right before getting to this location) in the stream that is pointed to by this reader, right before the start of the current event. |
| public long | getStartingCharOffset()
Implements org. Method that can be used to get exact character offset (number of chars read from the stream right before getting to this location) in the stream that is pointed to by this reader, right before the start of the current event. |
| public String | getText()
Implements javax. Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. |
| public int | Returns: Number of characters written to the readerWriter to use for writing textual contents w, boolean If true, reader has to preserve contents
so that further calls to preserveContents)getText will return
proper conntets. If false, reader is allowed to skip creation
of such copies: this can improve performance, but it also means
that further calls to getText is not guaranteed to
return meaningful data.Implements org. Method similar to |
| public char[] | getTextCharacters()
Implements javax. Returns an array which contains the characters from this event. |
| public int | getTextCharacters(int
the index of the first character in the source array to copy sourceStart, char[] the destination array target, int the start offset in the target array targetStart, int the number of characters to copy len)Implements javax. Gets the text associated with a CHARACTERS, SPACE or CDATA event. |
| public int | getTextLength()
Implements javax. Returns the length of the sequence of characters for this Text event within the text character array. |
| public int | getTextStart()
Implements javax. Returns the offset into the text character array where the first character (of this text event) is stored. |
| public String | getVersion()
Implements javax. Get the xml version declared on the xml declaration Returns null if none was declared |
| protected int | |
| private int | Returns: Token to returnCharacter passed in (not currently used) c)Method called if a root-level element is found after the main root element was closed. |
| protected void | handleGreedyEntityProblem(WstxInputSource input)
This problem gets reported if an entity tries to expand to a close tag matching start tag that did not came from the same entity (but from parent). |
| protected void | handleIncompleteEntityProblem(WstxInputSource closing)
Implements abstract com.
|
| protected int | Returns: Event type to returnMethod called when an event was encountered that indicates document boundary in multi-doc mode. |
| protected void | |
| private final boolean | |
| private final boolean | |
| protected void | |
| private final void | handleStartElem(char c)
Method that takes care of parsing of start elements; including full parsing of namespace declarations and attributes, as well as namespace resolution. |
| protected void | handleUndeclaredEntity(String id)
Implements abstract com. This method gets called if a declaration for an entity was not found in entity expanding mode (enabled by default for xml reader, always enabled for dtd reader). |
| protected final boolean | |
| public boolean | hasName()
Implements javax. returns a boolean indicating whether the current event has a name (is a START_ELEMENT or END_ELEMENT). |
| public boolean | hasNext()
Implements javax. Returns true if there are more parsing events and false if there are no more events. |
| public boolean | hasText()
Implements javax. Return a boolean indicating whether the current event has text. |
| protected void | |
| public boolean | isAttributeSpecified(int
the position of the attribute index)Implements javax. Returns a boolean which indicates if this attribute was created by default |
| public boolean | isCharacters()
Implements javax. Returns true if the cursor points to a character data event |
| public boolean | Returns: True, if cursor points to a start or end element that is constructed from 'empty' element (ends with'/>');
false otherwise.Implements org. Method that can be used to check whether current START_ELEMENT event was created for an empty element (xml short-hand notation where one tag implies start and end, ending with "/>"), or not. |
| public boolean | isEndElement()
Implements javax. Returns true if the cursor points to an end tag (otherwise false) |
| public boolean | |
| public boolean | isPropertySupported(String name)
Implements org. Method similar to |
| public boolean | isStandalone()
Implements javax. Get the standalone declaration from the xml declaration |
| public boolean | isStartElement()
Implements javax. Returns true if the cursor points to a start tag (otherwise false) |
| public boolean | isWhiteSpace()
Implements javax. 05-Apr-2004, TSa: Could try to determine status when text is actually read. |
| public final int | next()
Implements javax. Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. |
| private int | nextFromMultiDocState()
Method called to get the next event when we are "multi-doc hack" mode, during which extra END_DOCUMENT/START_DOCUMENT events need to be returned. |
| private boolean | Returns: True if we hit EOI, false otherwiseMethod called to find type of next token in prolog; either reading just enough information to know the type (lazy parsing), or the full contents (non-lazy) |
| private void | nextFromPrologBang(boolean isProlog)
Called after character sequence '<!' has been found; expectation is that it'll either be DOCTYPE declaration (if we are in prolog and haven't yet seen one), or a comment. |
| private final int | nextFromTree()
Method called to parse beginning of the next event within document tree, and return its type. |
| private int | nextFromTreeCommentOrCData()
Note According to StAX 1.0, coalesced text events are always to be returned as CHARACTERS, never as CDATA. |
| public int | nextTag()
Implements javax. Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached. |
| private final void | parseAttrValue(char
Quote character (single or double quote) for
this attribute value openingQuote, TextBuilder TextBuilder into which attribute value will be added tb)Method that will parse an attribute value enclosed in quotes, using
an |
| protected final void | parseQuoted(String name, char quoteChar, TextBuffer tbuf)
Method called to parse quoted xml declaration pseudo-attribute values. |
| private int | Returns: Total number of characters written using the writer for the current CDATA eventWriter to use for writing out textual content parsed w)Method called to read the contents of the current (possibly partially read) CDATA event, and write all contents using the specified Writer. |
| private int | Returns: Number of characters written to Writer during the call
|
| private int | Returns: Total number of characters written using the writerWriter to use for writing out textual content parsed w)Method called to read the contents of the current CHARACTERS event, and write all contents using the specified Writer. |
| private final boolean | Returns: True if the whole CDATA segment was completely read; this happens only if lt-char is hit; false if it's possible that it wasn't read (ie. end-of-buffer or entity encountered).First character in the CDATA segment (possibly part of end
marker for empty segments c)Method called to read in consecutive beginning parts of a CDATA segment, up to either end of the segment (]] and >) or until first 'hole' in text (buffer end, 2-char lf to convert, entity). |
| protected boolean | Returns: True if the whole CData section was completely read (we hit the end marker); false if a shorter segment was returned.
|
| protected void | readCoalescedText(int currType, boolean
Flag to enable storing an exception to a
variable, instead of immediately throwing it. If true, will
just store the exception; if false, will not store, just throw. deferErrors)Method called to read the content of both current CDATA/CHARACTERS events, and all following consequtive events into the text buffer. |
| private void | |
| private void | |
| protected final void | readEndElem()
Method called to completely read a close tag, and update element stack appropriately (including checking that tag matches etc). |
| private final int | Returns: -1, if the content was determined to be canonicalizable (indentation) white space; and thus fully parsed. Otherwise pointer (value to set to mInputPtr) to the next character to process (not processed by this method)Method called to try to parse and canonicalize white space that has a good chance of being white space with somewhat regular structure; specifically, something that looks like typical indentation. |
| private void | readPI()
Method that parses a processing instruction's data portion; at this point target has been parsed. |
| private void | |
| private final int | Returns: UsuallyPROCESSING_INSTRUCTION; but may be
different in multi-doc mode, if we actually hit a secondary
xml declaration.Method that reads the primary part of a PI, ie. |
| private final boolean | Returns: True if the whole white space segment was read; false if something prevented that (end of buffer, replaceable 2-char lf)First white space characters; known to contain white space
at this point c, boolean If true, is reading white space outside XML tree,
and as such can get EOF. If false, should not get EOF, nor be
followed by any other char than < prologWS)Reading whitespace should be very similar to reading normal text; although couple of simplifications can be made. |
| private void | readSpaceSecondary(boolean
True if the ignorable white space is within prolog
(or epilog); false if it's within xml tree. prologWS)This is very similar to readSecondaryText(); called when we need to read in rest of (ignorable) white space segment. |
| private final boolean | Returns: True if the whole text segment was completely read; this happens only if lt-char is hit; false if it's possible that it wasn't read (ie. end-of-buffer or entity encountered).First character of the text segment c)Method called to read in consecutive beginning parts of a text segment, up to either end of the segment (lt char) or until first 'hole' in text (buffer end, 2-char lf to convert, entity). |
| protected final boolean | Returns: True if the text segment was completely read ('<' was hit,
or in non-entity-expanding mode, a non-char entity); false if
it may still continueFlag to enable storing an exception to a
variable, instead of immediately throwing it. If true, will
just store the exception; if false, will not store, just throw. deferErrors)
|
| private void | |
| protected void | reportInvalidContent(int
Type of event that contained unexpected content evtType)Stub method implemented by validating parsers, to report content that's not valid for current element context. |
| private void | |
| private void | |
| public void | require(int
the event type type, String the uri of the event, may be null nsUri, String the localName of the event, may be null localName)Implements javax. Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event. |
| protected void | |
| protected void | |
| public void | setFeature(String
Name of the feature to set name, Object Value to set feature to. value)Implements org.
Deprecated
Method that can be used to set per-reader features such as configuration settings; both generic ones (names for which are defined as constants in this class), and implementation dependant ones. |
| public boolean | Returns: True, if the specified property was succesfully set to specified value; false if its value was not changedName of the property to set name, Object Value to set property to. value)Implements org. Method that can be used to set per-reader properties; a subset of
properties one can set via matching
|
| public ValidationProblemHandler | setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be used h)Implements org. Method that application can call to define a custom handler for validation problems encountered during validation process. |
| private int | Returns: Character following all the skipped text and CDATA segments, if any; or -1 to denote EOFMethod called to skip past all following text and CDATA segments, until encountering something else (including a general entity, which may in turn expand to text). |
| private void | |
| public void | skipElement()
Implements org. Method that will skip all the contents of the element that the stream currently points to. |
| protected final char | skipEquals(String name, String eofMsg)
Method that checks that input following is of form '[S]* '=' [S]*' (as per XML specs, production #25). |
| private int | Returns: Next character after node has been skipped, or -1 if EOF followsMethod called to skip last part of current token, when full token has not been parsed. |
| private int | |
| protected final boolean | Returns: true If at least one white space was skipped; false if not (character passed was not white space)Method that will skip any white space from input source(s) |
| public boolean | standaloneSet()
Implements javax. Checks if standalone was set in the document |
| private void | startDTD()
Method called to parse through most of DOCTYPE declaration; excluding optional internal subset. |
| public XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Implements org. Method that can be called by application to stop validating
output against a schema, for which |
| public XMLValidator | stopValidatingAgainst(XMLValidator validator)
Implements org. Method that can be called by application to stop validating output using specified validator. |
| private void | |
| protected void | |
| private void | |
| protected void | |
| public XMLValidator | validateAgainst(XMLValidationSchema schema)
Implements org. Method that will construct a |
| public Object | Returns: Null, if stream does not point to start element; whatever callback returns otherwise.Implements com. Method called by |