public abstract class BasicStreamReader extends StreamScanner implements StreamReaderImpl, org.codehaus.stax2.DTDInfo, org.codehaus.stax2.LocationInfo
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 |
---|---|
(package private) static int |
ALL_WS_NO |
(package private) static int |
ALL_WS_UNKNOWN |
(package private) static int |
ALL_WS_YES |
(package private) static int |
DOC_STANDALONE_NO |
(package private) static int |
DOC_STANDALONE_UNKNOWN |
(package private) static int |
DOC_STANDALONE_YES |
private static int |
INDENT_CHECK_MAX |
private static int |
INDENT_CHECK_START |
protected static int |
MASK_GET_ELEMENT_TEXT |
protected static int |
MASK_GET_TEXT
This mask covers all types for which basic
getText() method
can be called. |
protected static 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 int |
MASK_GET_TEXT_XXX
This mask covers all types for which extends
getTextXxx
methods can be called; which is less than those for which
getText() can be called. |
protected AttributeCollector |
mAttrCollector
Object that stores information about currently accessible attributes.
|
protected boolean |
mCfgCoalesceText |
protected boolean |
mCfgLazyParsing |
protected boolean |
mCfgReportTextAsChars |
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 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
getEventType() . |
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 java.lang.String |
mDtdPublicId
Public id of the DTD, if one exists and has been parsed.
|
protected java.lang.String |
mDtdSystemId
System id of the DTD, if one exists and has been parsed.
|
protected InputElementStack |
mElementStack
Currently open element tree
|
protected java.util.Map<java.lang.String,EntityDecl> |
mGeneralEntities
Entities parsed from internal/external DTD subsets.
|
protected 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 javax.xml.stream.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
getText and its variations), we may need
to delay throwing an exception until next() is called next
time. |
protected boolean |
mReturnNullForDefaultNamespace
Configuration from
WstxInputProperties#RETURN_NULL_FOR_DEFAULT_NAMESPACE |
protected java.lang.String |
mRootLName
Local name of root element, as dictated by DOCTYPE declaration; null
if no DOCTYPE declaration.
|
protected java.lang.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
mCurrToken is already populated. |
protected 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 |
mStDoctypeFound |
protected boolean |
mStEmptyElem |
protected 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 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 java.lang.String |
sPrefixXml |
protected static java.lang.String |
sPrefixXmlns |
(package private) static int |
STATE_CLOSED |
(package private) static int |
STATE_EPILOG |
(package private) static int |
STATE_MULTIDOC_HACK |
(package private) static int |
STATE_PROLOG |
(package private) static int |
STATE_TREE |
(package private) static int |
TOKEN_FULL_COALESCED |
(package private) static int |
TOKEN_FULL_SINGLE |
(package private) static int |
TOKEN_NOT_STARTED |
(package private) static int |
TOKEN_PARTIAL_SINGLE |
(package private) static int |
TOKEN_STARTED |
CHAR_CR_LF_OR_NULL, CHAR_FIRST_PURE_TEXT, CHAR_LOWEST_LEGAL_LOCALNAME_CHAR, INT_CR_LF_OR_NULL, mAllowXml11EscapedCharsInXml10, mCachedEntities, mCfgNsEnabled, mCfgReplaceEntities, mCfgTreatCharRefsAsEntities, mConfig, mCurrDepth, mCurrEntity, mCurrName, mDocInputEncoding, mDocXmlEncoding, mDocXmlVersion, mEntityExpansionCount, mEntityResolver, mInput, mInputTopDepth, mNameBuffer, mNormalizeLFs, mRootInput, mSymbols, mTokenInputCol, mTokenInputRow, mTokenInputTotal
CHAR_NULL, CHAR_SPACE, INT_NULL, INT_SPACE, MAX_UNICODE_CHAR, mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mInputBuffer, mInputEnd, mInputPtr, mXml11
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
CFG_ALLOW_XML11_ESCAPED_CHARS_IN_XML10, CFG_AUTO_CLOSE_INPUT, CFG_CACHE_DTDS, CFG_CACHE_DTDS_BY_PUBLIC_ID, CFG_COALESCE_TEXT, CFG_INTERN_NAMES, CFG_INTERN_NS_URIS, CFG_JAXP_FEATURE_SECURE_PROCESSING, CFG_LAZY_PARSING, CFG_NAMESPACE_AWARE, CFG_NORMALIZE_LFS, CFG_PRESERVE_LOCATION, CFG_REPLACE_ENTITY_REFS, CFG_REPORT_CDATA, CFG_REPORT_PROLOG_WS, CFG_SUPPORT_DTD, CFG_SUPPORT_DTDPP, CFG_SUPPORT_EXTERNAL_ENTITIES, CFG_TREAT_CHAR_REFS_AS_ENTS, CFG_VALIDATE_AGAINST_DTD, CFG_XMLID_TYPING, CFG_XMLID_UNIQ_CHECKS
SUFFIX_EOF_EXP_NAME, SUFFIX_IN_ATTR_VALUE, SUFFIX_IN_CDATA, SUFFIX_IN_CLOSE_ELEMENT, SUFFIX_IN_COMMENT, SUFFIX_IN_DEF_ATTR_VALUE, SUFFIX_IN_DOC, SUFFIX_IN_DTD, SUFFIX_IN_DTD_EXTERNAL, SUFFIX_IN_DTD_INTERNAL, SUFFIX_IN_ELEMENT, SUFFIX_IN_ENTITY_REF, SUFFIX_IN_EPILOG, SUFFIX_IN_NAME, SUFFIX_IN_PROC_INSTR, SUFFIX_IN_PROLOG, SUFFIX_IN_TEXT, SUFFIX_IN_XML_DECL
Modifier | Constructor and Description |
---|---|
protected |
BasicStreamReader(InputBootstrapper bs,
BranchingReaderSource input,
ReaderCreator owner,
ReaderConfig cfg,
InputElementStack elemStack,
boolean forER) |
Modifier and Type | Method and Description |
---|---|
protected org.codehaus.stax2.typed.TypedXMLStreamException |
_constructTypeException(java.lang.String msg,
java.lang.String lexicalValue) |
protected javax.xml.stream.XMLStreamException |
_constructUnexpectedInTyped(int nextToken)
Method called to report a problem with
|
private char[] |
_expandOutputForText(int inputPtr,
char[] outBuf,
int shortestSegment) |
protected void |
checkCData() |
private boolean |
checkCDataEnd(char[] outBuf,
int outPtr)
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 java.lang.String |
checkKeyword(char c,
java.lang.String expected) |
void |
close()
Note: as per StAX 1.0 specs, this method does NOT close the underlying
input reader.
|
void |
closeCompletely() |
private int |
closeContentTree()
Method called when advancing stream past the end tag that closes
the root element of the open document.
|
protected static InputElementStack |
createElementStack(ReaderConfig cfg) |
protected void |
ensureFinishToken() |
protected EntityDecl |
findEntity(java.lang.String id,
java.lang.Object arg)
Abstract method for sub-classes to implement, for finding
a declared general or parsed entity.
|
protected void |
finishDTD(boolean copyContents)
This method gets called to handle remainder of DOCTYPE declaration,
essentially the optional internal subset.
|
protected void |
finishToken(boolean deferErrors)
Method called to read in contents of the token completely, if not
yet read.
|
void |
fireSaxCharacterEvents(org.xml.sax.ContentHandler h) |
void |
fireSaxCommentEvent(org.xml.sax.ext.LexicalHandler h) |
void |
fireSaxEndElement(org.xml.sax.ContentHandler h) |
void |
fireSaxPIEvent(org.xml.sax.ContentHandler h) |
void |
fireSaxSpaceEvents(org.xml.sax.ContentHandler h) |
void |
fireSaxStartElement(org.xml.sax.ContentHandler h,
org.xml.sax.Attributes attrs) |
AttributeCollector |
getAttributeCollector()
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.
|
int |
getAttributeCount() |
org.codehaus.stax2.AttributeInfo |
getAttributeInfo() |
java.lang.String |
getAttributeLocalName(int index) |
javax.xml.namespace.QName |
getAttributeName(int index) |
java.lang.String |
getAttributeNamespace(int index) |
java.lang.String |
getAttributePrefix(int index) |
java.lang.String |
getAttributeType(int index) |
java.lang.String |
getAttributeValue(int index) |
java.lang.String |
getAttributeValue(java.lang.String nsURI,
java.lang.String localName) |
java.lang.String |
getCharacterEncodingScheme()
As per Stax (1.0) specs, needs to return whatever xml declaration
claimed encoding is, if any; or null if no xml declaration found.
|
EntityDecl |
getCurrentEntityDecl() |
int |
getDepth() |
org.codehaus.stax2.DTDInfo |
getDTDInfo()
Since this class implements
DTDInfo , method can just
return this . |
java.lang.String |
getDTDInternalSubset() |
private char[] |
getDTDInternalSubsetArray()
Internal method used by implementation
|
java.lang.String |
getDTDPublicId() |
java.lang.String |
getDTDRootName() |
java.lang.String |
getDTDSystemId() |
java.lang.String |
getElementText()
From StAX specs:
Reads the content of a text-only element, an exception is thrown if
this is not a text-only element.
|
java.lang.String |
getEncoding()
As per Stax (1.0) specs, needs to return whatever parser determined
the encoding was, if it was able to figure it out.
|
long |
getEndingByteOffset() |
long |
getEndingCharOffset() |
org.codehaus.stax2.XMLStreamLocation2 |
getEndLocation() |
int |
getEventType()
Returns type of the last event returned; or START_DOCUMENT before
any events has been explicitly returned.
|
java.lang.Object |
getFeature(java.lang.String name)
Deprecated.
|
InputElementStack |
getInputElementStack()
Method needed by classes (like stream writer implementations)
that want to have efficient direct access to element stack
implementation
|
java.lang.String |
getLocalName() |
javax.xml.stream.Location |
getLocation()
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).
|
org.codehaus.stax2.LocationInfo |
getLocationInfo()
Location information is always accessible, for this reader.
|
javax.xml.namespace.QName |
getName() |
javax.xml.namespace.NamespaceContext |
getNamespaceContext() |
int |
getNamespaceCount() |
java.lang.String |
getNamespacePrefix(int index) |
java.lang.String |
getNamespaceURI() |
java.lang.String |
getNamespaceURI(int index) |
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
javax.xml.namespace.NamespaceContext |
getNonTransientNamespaceContext() |
java.lang.String |
getPIData() |
java.lang.String |
getPITarget() |
java.lang.String |
getPrefix() |
java.lang.String |
getPrefixedName() |
java.lang.Object |
getProcessedDTD()
Note: DTD-handling sub-classes need to override this method.
|
org.codehaus.stax2.validation.DTDValidationSchema |
getProcessedDTDSchema()
Sub-class will override this method
|
java.lang.Object |
getProperty(java.lang.String name) |
long |
getStartingByteOffset() |
long |
getStartingCharOffset() |
java.lang.String |
getText() |
int |
getText(java.io.Writer w,
boolean preserveContents)
Method similar to
getText() , except
that it just uses provided Writer to write all textual content. |
char[] |
getTextCharacters() |
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int len) |
int |
getTextLength() |
int |
getTextStart() |
java.lang.String |
getVersion() |
protected int |
handleEOF(boolean isProlog) |
private int |
handleExtraRoot(char 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) |
protected int |
handleMultiDocStart(int nextEvent)
Method called when an event was encountered that indicates document
boundary in multi-doc mode.
|
protected void |
handleMultiDocXmlDecl() |
private boolean |
handleNonNsAttrs(char c) |
private boolean |
handleNsAttrs(char c) |
protected void |
handleRootElem(char c) |
private 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(java.lang.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 boolean |
hasConfigFlags(int flags) |
boolean |
hasName() |
boolean |
hasNext() |
boolean |
hasText() |
protected void |
initValidation()
Method called right before the document root element is handled.
|
boolean |
isAttributeSpecified(int index) |
boolean |
isCharacters() |
boolean |
isEmptyElement() |
boolean |
isEndElement() |
boolean |
isNamespaceAware() |
boolean |
isPropertySupported(java.lang.String name) |
boolean |
isStandalone() |
boolean |
isStartElement() |
boolean |
isWhiteSpace()
05-Apr-2004, TSa: Could try to determine status when text is actually
read.
|
int |
next() |
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 |
nextFromProlog(boolean isProlog)
Method 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 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.
|
int |
nextTag() |
private void |
parseAttrValue(char openingQuote,
TextBuilder tb)
Method that will parse an attribute value enclosed in quotes, using
an
TextBuilder instance. |
protected void |
parseQuoted(java.lang.String name,
char quoteChar,
TextBuffer tbuf)
Method called to parse quoted xml declaration pseudo-attribute values.
|
private int |
readAndWriteCData(java.io.Writer 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 |
readAndWriteCoalesced(java.io.Writer w,
boolean wasCData) |
private int |
readAndWriteText(java.io.Writer w)
Method called to read the contents of the current CHARACTERS
event, and write all contents using the specified Writer.
|
private boolean |
readCDataPrimary(char 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 |
readCDataSecondary(int shortestSegment) |
protected void |
readCoalescedText(int currType,
boolean deferErrors)
Method called to read the content of both current CDATA/CHARACTERS
events, and all following consequtive events into the text buffer.
|
private void |
readComment() |
private void |
readComment2(TextBuffer tb) |
protected void |
readEndElem()
Method called to completely read a close tag, and update element
stack appropriately (including checking that tag matches etc).
|
private int |
readIndentation(char c,
int ptr)
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 |
readPI2(TextBuffer tb) |
private int |
readPIPrimary()
Method that reads the primary part of a PI, ie.
|
private boolean |
readSpacePrimary(char c,
boolean prologWS)
Reading whitespace should be very similar to reading normal text;
although couple of simplifications can be made.
|
private void |
readSpaceSecondary(boolean prologWS)
This is very similar to readSecondaryText(); called when we need
to read in rest of (ignorable) white space segment.
|
private boolean |
readTextPrimary(char 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 boolean |
readTextSecondary(int shortestSegment,
boolean deferErrors) |
private void |
reportExtraEndElem() |
protected void |
reportInvalidContent(int evtType)
Stub method implemented by validating parsers, to report content
that's not valid for current element context.
|
private void |
reportWrongEndElem(java.lang.String prefix,
java.lang.String localName,
int done) |
private void |
reportWrongEndPrefix(java.lang.String prefix,
java.lang.String localName,
int done) |
void |
require(int type,
java.lang.String nsUri,
java.lang.String localName) |
protected void |
safeEnsureFinishToken() |
protected void |
safeFinishToken() |
void |
setFeature(java.lang.String name,
java.lang.Object value)
Deprecated.
|
boolean |
setProperty(java.lang.String name,
java.lang.Object value) |
org.codehaus.stax2.validation.ValidationProblemHandler |
setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) |
private int |
skipCoalescedText(int i)
Method 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 |
skipCommentOrCData(java.lang.String errorMsg,
char endChar,
boolean preventDoubles) |
void |
skipElement() |
protected char |
skipEquals(java.lang.String name,
java.lang.String eofMsg)
Method that checks that input following is of form
'[S]* '=' [S]*' (as per XML specs, production #25).
|
private int |
skipToken()
Method called to skip last part of current token, when full token
has not been parsed.
|
private int |
skipTokenText(int i) |
protected boolean |
skipWS(char c)
Method that will skip any white space from input source(s)
|
boolean |
standaloneSet() |
private void |
startDTD()
Method called to parse through most of DOCTYPE declaration; excluding
optional internal subset.
|
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) |
private void |
throwNotTextual(int type) |
protected void |
throwNotTextualOrElem(int type) |
private void |
throwNotTextXxx(int type) |
protected void |
throwUnexpectedEOF()
Method called when we get an EOF within content tree
|
org.codehaus.stax2.validation.XMLValidator |
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
java.lang.Object |
withStartElement(ElemCallback cb,
javax.xml.stream.Location loc)
Method called by
DefaultEventAllocator
to get double-indirection necessary for constructing start element
events. |
_reportProblem, _reportProblem, closeAllInput, constructFromIOE, constructLimitViolation, constructNullCharException, constructWfcException, ensureInput, expandBy50Pct, expandEntity, fullyResolveEntity, getConfig, getCurrentInput, getCurrentLocation, getIntEntity, getLastCharLocation, getNameBuffer, getNext, getNextAfterWS, getNextChar, getNextCharAfterWS, getNextCharFromCurrent, getNextInCurrAfterWS, getNextInCurrAfterWS, getSource, getStartLocation, getSystemId, initInputSource, inputInBuffer, loadMore, loadMore, loadMoreFromCurrent, loadMoreFromCurrent, markLF, markLF, parseEntityName, parseFNameForError, parseFullName, parseFullName, parseFullName2, parseLocalName, parseLocalName2, parsePublicId, parseSystemId, parseUntil, peekNext, pushback, reportProblem, reportProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, resolveCharOnlyEntity, resolveNonCharEntity, resolveSimpleEntity, skipCRLF, skipFullName, throwFromIOE, throwFromStrE, throwInvalidSpace, throwInvalidSpace, throwLazyError, throwNullChar, throwNullParent, throwParseError, throwParseError, throwUnexpectedChar, throwUnexpectedEOB, throwUnexpectedEOF, throwWfcException, tokenTypeDesc, verifyLimit
copyBufferStateFrom, findIllegalNameChar, findIllegalNmtokenChar, getCharDesc, isNameChar, isNameChar, isNameStartChar, isNameStartChar, isSpaceChar
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttributeAs, getAttributeAsArray, getAttributeAsBinary, getAttributeAsBinary, getAttributeAsBoolean, getAttributeAsDecimal, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLongArray, getAttributeAsQName, getAttributeIndex, getElementAs, getElementAsBinary, getElementAsBinary, getElementAsBoolean, getElementAsDecimal, getElementAsDouble, getElementAsFloat, getElementAsInt, getElementAsInteger, getElementAsLong, getElementAsQName, readElementAsArray, readElementAsBinary, readElementAsBinary, readElementAsDoubleArray, readElementAsFloatArray, readElementAsIntArray, readElementAsLongArray
static final int DOC_STANDALONE_UNKNOWN
static final int DOC_STANDALONE_YES
static final int DOC_STANDALONE_NO
static final int STATE_PROLOG
static final int STATE_TREE
static final int STATE_EPILOG
static final int STATE_MULTIDOC_HACK
static final int STATE_CLOSED
static final int TOKEN_NOT_STARTED
static final int TOKEN_STARTED
static final int TOKEN_PARTIAL_SINGLE
static final int TOKEN_FULL_SINGLE
static final int TOKEN_FULL_COALESCED
protected static final int MASK_GET_TEXT
getText()
method
can be called.protected static final int MASK_GET_TEXT_XXX
getTextXxx
methods can be called; which is less than those for which
getText()
can be called. Specifically, DTD
and
ENTITY_REFERENCE
types do not support these extendedprotected static final int MASK_GET_TEXT_WITH_WRITER
protected static final int MASK_GET_ELEMENT_TEXT
static final int ALL_WS_UNKNOWN
static final int ALL_WS_YES
static final int ALL_WS_NO
private static final int INDENT_CHECK_START
private static final int INDENT_CHECK_MAX
protected static final java.lang.String sPrefixXml
protected static final java.lang.String sPrefixXmlns
protected final int mConfigFlags
protected final boolean mCfgCoalesceText
protected final boolean mCfgReportTextAsChars
protected final boolean mCfgLazyParsing
protected final int mShortestTextSegment
protected final ReaderCreator mOwner
protected int mDocStandalone
protected java.lang.String mRootPrefix
protected java.lang.String mRootLName
protected java.lang.String mDtdPublicId
protected java.lang.String mDtdSystemId
protected final TextBuffer mTextBuffer
protected final InputElementStack mElementStack
protected final AttributeCollector mAttrCollector
protected boolean mStDoctypeFound
protected int mTokenState
Initially set to fully tokenized, since it's the virtual START_DOCUMENT event that we fully know by now (parsed by bootstrapper)
protected final int mStTextThreshold
protected int mCurrTextLength
protected boolean mStEmptyElem
protected int mParseState
protected int mCurrToken
getEventType()
. Needs to be initialized to START_DOCUMENT,
since that's the state it starts in.protected int mSecondaryToken
mCurrToken
is already populated.protected int mWsStatus
protected boolean mValidateText
XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT
,
and will prevent lazy parsing of text.protected int mCheckIndentation
protected javax.xml.stream.XMLStreamException mPendingException
getText
and its variations), we may need
to delay throwing an exception until next()
is called next
time. If so, this variable holds the pending stream exception.protected java.util.Map<java.lang.String,EntityDecl> mGeneralEntities
protected int mVldContent
XMLValidator
,
(like XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT
).
Only used inside tree; ignored for prolog/epilog (which
have straight-forward static rules).protected boolean mReturnNullForDefaultNamespace
WstxInputProperties#RETURN_NULL_FOR_DEFAULT_NAMESPACE
protected BasicStreamReader(InputBootstrapper bs, BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputElementStack elemStack, boolean forER) throws javax.xml.stream.XMLStreamException
elemStack
- Input element stack to use; if null, will create
instance locally.forER
- 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.javax.xml.stream.XMLStreamException
protected static InputElementStack createElementStack(ReaderConfig cfg)
public java.lang.String getCharacterEncodingScheme()
Note: method name is rather confusing (compare to getEncoding()
).
getCharacterEncodingScheme
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getEncoding()
Reader
), it should return null.getEncoding
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getVersion()
getVersion
in interface javax.xml.stream.XMLStreamReader
public boolean isStandalone()
isStandalone
in interface javax.xml.stream.XMLStreamReader
public boolean standaloneSet()
standaloneSet
in interface javax.xml.stream.XMLStreamReader
public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface javax.xml.stream.XMLStreamReader
public int getAttributeCount()
getAttributeCount
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeLocalName(int index)
getAttributeLocalName
in interface javax.xml.stream.XMLStreamReader
public javax.xml.namespace.QName getAttributeName(int index)
getAttributeName
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeNamespace(int index)
getAttributeNamespace
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributePrefix(int index)
getAttributePrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeType(int index)
getAttributeType
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeValue(int index)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeValue(java.lang.String nsURI, java.lang.String localName)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getElementText() throws javax.xml.stream.XMLStreamException
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.
getElementText
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int getEventType()
getEventType
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getLocalName()
getLocalName
in interface javax.xml.stream.XMLStreamReader
public javax.xml.namespace.QName getName()
getName
in interface javax.xml.stream.XMLStreamReader
public javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext
in interface javax.xml.stream.XMLStreamReader
public int getNamespaceCount()
getNamespaceCount
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespacePrefix(int index)
getNamespacePrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespaceURI(int index)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPIData()
getPIData
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPITarget()
getPITarget
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPrefix()
getPrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getText()
getText
in interface javax.xml.stream.XMLStreamReader
public char[] getTextCharacters()
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int len)
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
public int getTextLength()
getTextLength
in interface javax.xml.stream.XMLStreamReader
public int getTextStart()
getTextStart
in interface javax.xml.stream.XMLStreamReader
public boolean hasName()
hasName
in interface javax.xml.stream.XMLStreamReader
public boolean hasNext()
hasNext
in interface javax.xml.stream.XMLStreamReader
public boolean hasText()
hasText
in interface javax.xml.stream.XMLStreamReader
public boolean isAttributeSpecified(int index)
isAttributeSpecified
in interface javax.xml.stream.XMLStreamReader
public boolean isCharacters()
isCharacters
in interface javax.xml.stream.XMLStreamReader
public boolean isEndElement()
isEndElement
in interface javax.xml.stream.XMLStreamReader
public boolean isStartElement()
isStartElement
in interface javax.xml.stream.XMLStreamReader
public boolean isWhiteSpace()
05-Apr-2004, TSa: Could try to determine status when text is actually read. That'd prevent double reads... but would it slow down that one reading so that net effect would be negative?
isWhiteSpace
in interface javax.xml.stream.XMLStreamReader
public void require(int type, java.lang.String nsUri, java.lang.String localName) throws javax.xml.stream.XMLStreamException
require
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final int next() throws javax.xml.stream.XMLStreamException
next
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int nextTag() throws javax.xml.stream.XMLStreamException
nextTag
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public void close() throws javax.xml.stream.XMLStreamException
Note: as per StAX 1.0 specs, this method does NOT close the underlying
input reader. That is, unless the new StAX2 property
XMLInputFactory2.P_AUTO_CLOSE_INPUT
is
set to true.
close
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
@Deprecated public java.lang.Object getFeature(java.lang.String name)
getFeature
in interface org.codehaus.stax2.XMLStreamReader2
@Deprecated public void setFeature(java.lang.String name, java.lang.Object value)
setFeature
in interface org.codehaus.stax2.XMLStreamReader2
public boolean isPropertySupported(java.lang.String name)
isPropertySupported
in interface org.codehaus.stax2.XMLStreamReader2
public boolean setProperty(java.lang.String name, java.lang.Object value)
setProperty
in interface org.codehaus.stax2.XMLStreamReader2
name
- Name of the property to setvalue
- Value to set property to.public void skipElement() throws javax.xml.stream.XMLStreamException
skipElement
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.AttributeInfo getAttributeInfo() throws javax.xml.stream.XMLStreamException
getAttributeInfo
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.DTDInfo getDTDInfo() throws javax.xml.stream.XMLStreamException
DTDInfo
, method can just
return this
.getDTDInfo
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.LocationInfo getLocationInfo()
getLocationInfo
in interface org.codehaus.stax2.XMLStreamReader2
public int getText(java.io.Writer w, boolean preserveContents) throws java.io.IOException, javax.xml.stream.XMLStreamException
getText()
, except
that it just uses provided Writer to write all textual content.
For further optimization, it may also be allowed to do true
pass-through, thus possibly avoiding one temporary copy of the
data.
TODO: try to optimize to allow completely streaming pass-through: currently will still read all data in memory buffers before outputting
getText
in interface org.codehaus.stax2.XMLStreamReader2
w
- Writer to use for writing textual contentspreserveContents
- If true, reader has to preserve contents
so that further calls to 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.java.io.IOException
javax.xml.stream.XMLStreamException
public int getDepth()
getDepth
in interface org.codehaus.stax2.XMLStreamReader2
public boolean isEmptyElement() throws javax.xml.stream.XMLStreamException
isEmptyElement
in interface org.codehaus.stax2.XMLStreamReader2
'/>'
);
false otherwise.javax.xml.stream.XMLStreamException
public javax.xml.namespace.NamespaceContext getNonTransientNamespaceContext()
getNonTransientNamespaceContext
in interface org.codehaus.stax2.XMLStreamReader2
public java.lang.String getPrefixedName()
getPrefixedName
in interface org.codehaus.stax2.XMLStreamReader2
public void closeCompletely() throws javax.xml.stream.XMLStreamException
closeCompletely
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public java.lang.Object getProcessedDTD()
Note: DTD-handling sub-classes need to override this method.
getProcessedDTD
in interface org.codehaus.stax2.DTDInfo
public java.lang.String getDTDRootName()
getDTDRootName
in interface org.codehaus.stax2.DTDInfo
public java.lang.String getDTDPublicId()
getDTDPublicId
in interface org.codehaus.stax2.DTDInfo
public java.lang.String getDTDSystemId()
getDTDSystemId
in interface org.codehaus.stax2.DTDInfo
public java.lang.String getDTDInternalSubset()
getDTDInternalSubset
in interface org.codehaus.stax2.DTDInfo
private char[] getDTDInternalSubsetArray()
public org.codehaus.stax2.validation.DTDValidationSchema getProcessedDTDSchema()
getProcessedDTDSchema
in interface org.codehaus.stax2.DTDInfo
public long getStartingByteOffset()
getStartingByteOffset
in interface org.codehaus.stax2.LocationInfo
public long getStartingCharOffset()
getStartingCharOffset
in interface org.codehaus.stax2.LocationInfo
public long getEndingByteOffset() throws javax.xml.stream.XMLStreamException
getEndingByteOffset
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public long getEndingCharOffset() throws javax.xml.stream.XMLStreamException
getEndingCharOffset
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public final javax.xml.stream.Location getLocation()
StreamScanner
getLocation
in interface InputProblemReporter
getLocation
in interface javax.xml.stream.XMLStreamReader
getLocation
in interface org.codehaus.stax2.LocationInfo
getLocation
in class StreamScanner
public final org.codehaus.stax2.XMLStreamLocation2 getEndLocation() throws javax.xml.stream.XMLStreamException
getEndLocation
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws javax.xml.stream.XMLStreamException
validateAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws javax.xml.stream.XMLStreamException
stopValidatingAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) throws javax.xml.stream.XMLStreamException
stopValidatingAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h)
setValidationProblemHandler
in interface org.codehaus.stax2.validation.Validatable
public EntityDecl getCurrentEntityDecl()
getCurrentEntityDecl
in interface StreamReaderImpl
public java.lang.Object withStartElement(ElemCallback cb, javax.xml.stream.Location loc)
DefaultEventAllocator
to get double-indirection necessary for constructing start element
events.withStartElement
in interface StreamReaderImpl
public boolean isNamespaceAware()
isNamespaceAware
in interface StreamReaderImpl
public InputElementStack getInputElementStack()
getInputElementStack
in interface StreamReaderImpl
public AttributeCollector getAttributeCollector()
getAttributeCollector
in interface StreamReaderImpl
public void fireSaxStartElement(org.xml.sax.ContentHandler h, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void fireSaxEndElement(org.xml.sax.ContentHandler h) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void fireSaxCharacterEvents(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
public void fireSaxSpaceEvents(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
public void fireSaxCommentEvent(org.xml.sax.ext.LexicalHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
public void fireSaxPIEvent(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
protected final boolean hasConfigFlags(int flags)
protected java.lang.String checkKeyword(char c, java.lang.String expected) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void checkCData() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final void parseAttrValue(char openingQuote, TextBuilder tb) throws javax.xml.stream.XMLStreamException
TextBuilder
instance. Will normalize white space inside
attribute value using default XML rules (change linefeeds to spaces
etc.; but won't use DTD information for further coalescing).openingQuote
- Quote character (single or double quote) for
this attribute valuetb
- TextBuilder into which attribute value will be addedjavax.xml.stream.XMLStreamException
private boolean nextFromProlog(boolean isProlog) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void handleRootElem(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void initValidation() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected int handleEOF(boolean isProlog) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int handleExtraRoot(char c) throws javax.xml.stream.XMLStreamException
c
- Character passed in (not currently used)javax.xml.stream.XMLStreamException
protected int handleMultiDocStart(int nextEvent)
private int nextFromMultiDocState() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void handleMultiDocXmlDecl() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final char skipEquals(java.lang.String name, java.lang.String eofMsg) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void parseQuoted(java.lang.String name, char quoteChar, TextBuffer tbuf) throws javax.xml.stream.XMLStreamException
Note: since it'll be called at most 3 times per document, this method is not optimized too much.
javax.xml.stream.XMLStreamException
private void nextFromPrologBang(boolean isProlog) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void startDTD() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void finishDTD(boolean copyContents) throws javax.xml.stream.XMLStreamException
NOTE: Since this default implementation will be overridden by some sub-classes, make sure you do NOT change the method signature.
copyContents
- 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).javax.xml.stream.XMLStreamException
private final int nextFromTree() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int closeContentTree() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final void handleStartElem(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final boolean handleNsAttrs(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final boolean handleNonNsAttrs(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void readEndElem() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void reportExtraEndElem() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void reportWrongEndPrefix(java.lang.String prefix, java.lang.String localName, int done) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void reportWrongEndElem(java.lang.String prefix, java.lang.String localName, int done) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int nextFromTreeCommentOrCData() throws javax.xml.stream.XMLStreamException
Note: According to StAX 1.0, coalesced text events are always to be returned as CHARACTERS, never as CDATA. And since at this point we don't really know if there's anything to coalesce (but there may be), let's convert CDATA if necessary.
javax.xml.stream.XMLStreamException
private int skipToken() throws javax.xml.stream.XMLStreamException
Note: this method is to accurately update the location information to reflect where the next event will start (or, in case of EOF, where EOF was encountered, ie. where event would start, if there was one).
javax.xml.stream.XMLStreamException
private void skipCommentOrCData(java.lang.String errorMsg, char endChar, boolean preventDoubles) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int skipCoalescedText(int i) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int skipTokenText(int i) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void ensureFinishToken() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void safeEnsureFinishToken()
protected void safeFinishToken()
protected void finishToken(boolean deferErrors) throws javax.xml.stream.XMLStreamException
deferErrors
- 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.javax.xml.stream.XMLStreamException
private void readComment() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void readComment2(TextBuffer tb) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final int readPIPrimary() throws javax.xml.stream.XMLStreamException
PROCESSING_INSTRUCTION
; but may be
different in multi-doc mode, if we actually hit a secondary
xml declaration.javax.xml.stream.XMLStreamException
private void readPI() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void readPI2(TextBuffer tb) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void readCoalescedText(int currType, boolean deferErrors) throws javax.xml.stream.XMLStreamException
deferErrors
- 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.javax.xml.stream.XMLStreamException
private final boolean readCDataPrimary(char c) throws javax.xml.stream.XMLStreamException
When the method is called, it's expected that the first character has been read as is in the current input buffer just before current pointer
c
- First character in the CDATA segment (possibly part of end
marker for empty segmentsjavax.xml.stream.XMLStreamException
protected boolean readCDataSecondary(int shortestSegment) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private boolean checkCDataEnd(char[] outBuf, int outPtr) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private final boolean readTextPrimary(char c) throws javax.xml.stream.XMLStreamException
When the method is called, it's expected that the first character has been read as is in the current input buffer just before current pointer
c
- First character of the text segmentjavax.xml.stream.XMLStreamException
protected final boolean readTextSecondary(int shortestSegment, boolean deferErrors) throws javax.xml.stream.XMLStreamException
deferErrors
- 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.'<'
was hit,
or in non-entity-expanding mode, a non-char entity); false if
it may still continuejavax.xml.stream.XMLStreamException
private final char[] _expandOutputForText(int inputPtr, char[] outBuf, int shortestSegment)
private final int readIndentation(char c, int ptr) throws javax.xml.stream.XMLStreamException
Note: Caller guarantees that there will be at least 2 characters available in the input buffer. And method has to ensure that if it does not find a match, it will return pointer value such that there is at least one valid character remaining.
javax.xml.stream.XMLStreamException
private final boolean readSpacePrimary(char c, boolean prologWS) throws javax.xml.stream.XMLStreamException
c
- First white space characters; known to contain white space
at this pointprologWS
- 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 <javax.xml.stream.XMLStreamException
private void readSpaceSecondary(boolean prologWS) throws javax.xml.stream.XMLStreamException
prologWS
- True if the ignorable white space is within prolog
(or epilog); false if it's within xml tree.javax.xml.stream.XMLStreamException
private int readAndWriteText(java.io.Writer w) throws java.io.IOException, javax.xml.stream.XMLStreamException
w
- Writer to use for writing out textual content parsedjava.io.IOException
javax.xml.stream.XMLStreamException
private int readAndWriteCData(java.io.Writer w) throws java.io.IOException, javax.xml.stream.XMLStreamException
w
- Writer to use for writing out textual content parsedjava.io.IOException
javax.xml.stream.XMLStreamException
private int readAndWriteCoalesced(java.io.Writer w, boolean wasCData) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final boolean skipWS(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected EntityDecl findEntity(java.lang.String id, java.lang.Object arg) throws javax.xml.stream.XMLStreamException
StreamScanner
findEntity
in class StreamScanner
id
- Identifier of the entity to findarg
- Optional argument passed from caller; needed by DTD
reader.javax.xml.stream.XMLStreamException
protected void handleUndeclaredEntity(java.lang.String id) throws javax.xml.stream.XMLStreamException
StreamScanner
handleUndeclaredEntity
in class StreamScanner
javax.xml.stream.XMLStreamException
protected void handleIncompleteEntityProblem(WstxInputSource closing) throws javax.xml.stream.XMLStreamException
handleIncompleteEntityProblem
in class StreamScanner
javax.xml.stream.XMLStreamException
protected void handleGreedyEntityProblem(WstxInputSource input) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void throwNotTextual(int type)
private void throwNotTextXxx(int type)
protected void throwNotTextualOrElem(int type)
protected void throwUnexpectedEOF() throws WstxException
WstxException
protected javax.xml.stream.XMLStreamException _constructUnexpectedInTyped(int nextToken)
protected org.codehaus.stax2.typed.TypedXMLStreamException _constructTypeException(java.lang.String msg, java.lang.String lexicalValue)
protected void reportInvalidContent(int evtType) throws javax.xml.stream.XMLStreamException
evtType
- Type of event that contained unexpected contentjavax.xml.stream.XMLStreamException