| Modifier and Type | Field and Description |
|---|---|
| public static final char | CHAR_CR_LF_OR_NULL
Last (highest) char code of the three, LF, CR and NULL |
| protected static final char | CHAR_FIRST_PURE_TEXT
Character that allows quick check of whether a char can potentially
be some kind of markup, WRT input stream processing;
has to contain linefeeds, |
| protected static final char | CHAR_LOWEST_LEGAL_LOCALNAME_CHAR
First character in Unicode (ie one with lowest id) that is legal as part of a local name (all valid name chars minus ':'). |
| public static final int | |
| protected boolean | mAllowXml11EscapedCharsInXml10
Flag that indicates whether all escaped chars are accepted in XML 1.0. |
| protected Map | mCachedEntities
Cache of internal character entities; |
| protected final boolean | mCfgNsEnabled
If true, Reader is namespace aware, and should do basic checks (usually enforcing limitations on having colons in names) |
| protected boolean | mCfgReplaceEntities
Note left non-final on purpose: sub-class may need to modify the default value after construction. |
| protected boolean | mCfgTreatCharRefsAsEntities
Flag for whether or not character references should be treated as entities |
| protected final ReaderConfig | mConfig
Copy of the configuration object passed by the factory. |
| protected int | mCurrDepth
This is the current depth of the input stack (same as what input element stack would return as its depth). |
| protected EntityDecl | mCurrEntity
Entity reference stream currently points to. |
| protected String | mCurrName
Local full name for the event, if it has one (note: element events do NOT use this variable; those names are stored in element stack): target for processing instructions. |
| protected String | mDocInputEncoding
Input stream encoding, if known (passed in, or determined by auto-detection); null if not. |
| protected String | mDocXmlEncoding
Character encoding from xml declaration, if any; null if no declaration, or it didn't specify encoding. |
| protected int | mDocXmlVersion
XML version as declared by the document; one of constants
from |
| protected int | mEntityExpansionCount
Number of times a parsed general entity has been expanded; used for (optionally) limiting number of expansion to guard against denial-of-service attacks like "Billion Laughs". |
| protected XMLResolver | mEntityResolver
Custom resolver used to handle external entities that are to be expanded by this reader (external param/general entity expander) |
| protected WstxInputSource | mInput
Currently active input source; contains link to parent (nesting) input sources, if any. |
| protected int | |
| protected char[] | mNameBuffer
Temporary buffer used if local name can not be just directly constructed from input buffer (name is on a boundary or such). |
| protected boolean | mNormalizeLFs
Flag that indicates whether linefeeds in the input data are to be normalized or not. |
| protected final WstxInputSource | mRootInput
Top-most input source this reader can use; due to input source chaining, this is not necessarily the root of all input; for example, external DTD subset reader's root input still has original document input as its parent. |
| pack-priv final SymbolTable | |
| protected int | mTokenInputCol
Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based) |
| protected int | mTokenInputRow
Input row on which current token starts, 1-based |
| protected long | mTokenInputTotal
Total number of characters read before start of current token. |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte[] | |
| private static final byte[] | |
| private static final int | VALID_CHAR_COUNT
We will only use validity array for first 256 characters, mostly
because after those characters it's easier to do fairly simple
block checks.
|
| private static final int | VALID_PUBID_CHAR_COUNT
Public identifiers only use 7-bit ascii range.
|
| Access | Constructor and Description |
|---|---|
| protected | StreamScanner(WstxInputSource input, ReaderConfig cfg, XMLResolver res)
Constructor used when creating a complete new (main-level) reader that does not share its input buffers or state with another reader. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| protected void | |
| protected WstxException | constructFromIOE(IOException ioe)
Construct and return a |
| protected XMLStreamException | |
| protected WstxException | |
| protected WstxException | |
| protected boolean | Returns: true if there's now enough data; false if not (EOF)Method called to make sure current main-level input buffer has at
least specified number of characters available consequtively,
without having to call |
| protected final char[] | |
| protected EntityDecl | expandEntity(String
Name of the entity being expanded id, boolean Whether external entities can be expanded or not; if
not, and the entity to expand would be external one, an exception
will be thrown allowExt, Object extraArg)Helper method that will try to expand a parsed entity (parameter or generic entity). |
| private void | expandEntity(EntityDecl
Entity to be expanded ed, boolean Whether external entities are allowed or not. allowExt)Note defined as private for documentation, ie. |
| private EntityDecl | |
| protected abstract EntityDecl | findEntity(String
Identifier of the entity to find id, Object Optional argument passed from caller; needed by DTD
reader. arg)Abstract method for sub-classes to implement, for finding a declared general or parsed entity. |
| protected int | Returns: Either single-character replacement (which is NOT to be reparsed), or null char (0) to indicate expansion is done via input source.If true, is allowed to expand external entities
(expanding text); if false, is not (expanding attribute value). allowExt)Method that does full resolution of an entity reference, be it character entity, internal entity or external entity, including updating of input buffers, and depending on whether result is a character entity (or one of 5 pre-defined entities), returns char in question, or null character (code 0) to indicate it had to change input source. |
| public ReaderConfig | |
| public final WstxInputSource | |
| public XMLStreamLocation2 | |
| protected EntityDecl | getIntEntity(int ch, final char[] originalChars)
Returns an entity (possibly from cache) for the argument character using the encoded representation in mInputBuffer[entityStartPos ... |
| protected WstxInputLocation | getLastCharLocation()
Method that returns location of the last character returned by this reader; that is, location "one less" than the currently pointed to location. |
| public abstract Location | getLocation()
Redeclares com. Returns location of last properly parsed token; as per StAX specs, apparently needs to be the end of current event, which is the same as the start of the following event (or EOF if that's next). |
| protected final char[] | |
| protected final int | |
| protected final int | getNextAfterWS()
Method that will skip through zero or more white space characters, and return either the character following white space, or -1 to indicate EOF (end of the outermost input source)/ |
| protected final char | |
| protected final char | |
| protected final char | getNextCharFromCurrent(String errorMsg)
Similar to |
| protected final char | |
| protected final char | |
| protected URL | |
| public XMLStreamLocation2 | |
| protected String | |
| protected abstract void | |
| protected abstract void | handleUndeclaredEntity(String id)
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 void | initInputSource(WstxInputSource newInput, boolean isExt, String
Name of the entity being expanded entityId)Method called when an entity has been expanded (new input source has been created). |
| protected final int | |
| protected boolean | Returns: true if reading succeeded (or may succeed), false if we reached EOF.Method that will try to read one or more characters from currently open input sources; closing input sources if necessary. |
| protected final boolean | |
| protected boolean | |
| protected final boolean | |
| protected final void | |
| protected final void | |
| protected final String | |
| protected String | parseFNameForError()
Method called to read in full name, including unlimited number of namespace separators (':'), for the purpose of displaying name in an error message. |
| protected String | Returns: Canonicalized name String (which may have length 0, if EOF or non-name-start char encountered)Method that will parse 'full' name token; what full means depends on whether reader is namespace aware or not. |
| protected String | |
| protected String | |
| protected String | Returns: Canonicalized name String (which may have length 0, if EOF or non-name-start char encountered)First character of the name; not yet checked for validity c)Method that will parse name token (roughly equivalent to XML specs; although bit lenier for more efficient handling); either uri prefix, or local name. |
| protected String | parseLocalName2(int start, int hash)
Second part of name token parsing; called when name can continue past input buffer end (so only part was read before calling this method to read the rest). |
| protected final String | parsePublicId(char quoteChar, String errorMsg)
Simple parsing method that parses system ids, which are generally used in entities (from DOCTYPE declaration to internal/external subsets). |
| protected final String | parseSystemId(char quoteChar, boolean convertLFs, String errorMsg)
Simple parsing method that parses system ids, which are generally used in entities (from DOCTYPE declaration to internal/external subsets). |
| protected final void | |
| protected final int | |
| protected final void | pushback()
Method to push back last character read; can only be called once, that is, no more than one char can be guaranteed to be succesfully returned. |
| private void | |
| public void | |
| public void | reportProblem(Location loc, String probType, String format, Object arg, Object arg2)
Implements com.
|
| private void | |
| public void | reportValidationProblem(XMLValidationProblem prob)
Implements com. Note this is the base implementation used for implementing
|
| public void | |
| public void | |
| public void | |
| public void | reportValidationProblem(String format, Object arg, Object arg2)
Implements com.
|
| private int | |
| protected int | Returns: (Valid) character value, if entity is a character reference, and could be resolved from current input buffer (does not span buffer boundary); null char (code 0) if not (either non-char entity, or spans input buffer boundary).If true, will check pre-defined internal entities
(gt, lt, amp, apos, quot) as character entities; if false, will only
check actual 'real' character entities. checkStd)Method called to resolve character entities, and only character entities (except that pre-defined char entities -- amp, apos, lt, gt, quote -- MAY be "char entities" in this sense, depending on arguments). |
| protected EntityDecl | resolveNonCharEntity()
Reverse of |
| protected int | Returns: (Valid) character value, if entity is a character reference, and could be resolved from current input buffer (does not span buffer boundary); null char (code 0) if not (either non-char entity, or spans input buffer boundary).If true, will check pre-defined internal entities
(gt, lt, amp, apos, quot); if false, will only check actual
character entities. checkStd)Method that tries to resolve a character entity, or (if caller so specifies), a pre-defined internal entity (lt, gt, amp, apos, quot). |
| protected final boolean | Returns: True, if passed in char is '\r' and next one is '\n'.Method called when a CR has been spotted in input; checks if next char is LF, and if so, skips it. |
| protected int | Returns: Length of skipped name.Note does not check for number of colons, amongst other things. |
| protected void | |
| protected void | |
| protected void | |
| protected WstxException | |
| protected void | throwLazyError(Exception e)
Method called to report an error, when caller's signature only allows runtime exceptions to be thrown. |
| private void | throwNsColonException(String name)
Method called to throw an exception indicating that a name that should not be namespace-qualified (PI target, entity/notation name) is one, and reader is namespace aware. |
| protected void | |
| protected void | |
| public void | |
| public void | throwParseError(String format, Object arg, Object arg2)
Implements com. Throws generic parse error with specified message and current parsing location. |
| private void | |
| protected void | |
| protected void | throwUnexpectedEOB(String msg)
Similar to |
| protected void | |
| public WstxException | |
| protected String | |
| private final void | validateChar(int value)
Method that will verify that expanded Unicode codepoint is a valid XML content character. |
| protected void |