|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.io.WstxInputData
com.ctc.wstx.sr.StreamScanner
public abstract class StreamScanner
Abstract base class that defines some basic functionality that all Woodstox reader classes (main XML reader, DTD reader) extend from.
Field Summary | |
---|---|
static char |
CHAR_CR_LF_OR_NULL
Last (highest) char code of the three, LF, CR and NULL |
protected static 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, &, < and > (">" only matters when quoting text, as part of "]]>") |
protected static 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 ':'). |
static int |
INT_CR_LF_OR_NULL
|
protected boolean |
mCfgNormalizeLFs
Flag that indicates whether linefeeds in the input data are to be normalized or not. |
protected 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 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 java.lang.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 int |
mDocXmlVersion
XML version as declared by the document; one of constants from XmlConsts (like XmlConsts.XML_V_10 ). |
protected WstxInputSource |
mInput
Currently active input source; contains link to parent (nesting) input sources, if any. |
protected int |
mInputTopDepth
|
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 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. |
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. |
static boolean |
SAX_COMPAT_MODE
In case we want better compatibility with SAX parsers (like Xerces), this flag can be turned on. |
Fields inherited from class com.ctc.wstx.io.WstxInputData |
---|
CHAR_NULL, CHAR_SPACE, INT_NULL, INT_SPACE, MAX_UNICODE_CHAR, mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mInputBuffer, mInputLen, mInputPtr, mXml11 |
Constructor Summary | |
---|---|
protected |
StreamScanner(WstxInputSource input,
ReaderConfig cfg,
javax.xml.stream.XMLResolver res)
Constructor used when creating a complete new (main-level) reader that does not share its input buffers or state with another reader. |
Method Summary | |
---|---|
protected void |
closeAllInput(boolean force)
|
protected WstxException |
constructFromIoe(java.io.IOException ioe)
|
protected WstxException |
constructNullCharException()
|
protected WstxException |
constructWfcException(java.lang.String msg)
|
protected void |
doReportProblem(javax.xml.stream.XMLReporter rep,
java.lang.String probType,
java.lang.String msg,
javax.xml.stream.Location loc)
|
protected boolean |
ensureInput(int minAmount)
Method called to make sure current main-level input buffer has at least specified number of characters available consequtively, without having to call loadMore() . |
protected char[] |
expandBy50Pct(char[] buf)
|
protected EntityDecl |
expandEntity(java.lang.String id,
boolean allowExt,
java.lang.Object extraArg)
Helper method that will try to expand a parsed entity (parameter or generic entity). |
protected abstract 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 char |
fullyResolveEntity(boolean 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. |
WstxInputSource |
getCurrentInput()
Returns current input source this source uses. |
XMLStreamLocation2 |
getCurrentLocation()
|
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. |
abstract 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). |
protected char[] |
getNameBuffer(int minSize)
|
protected int |
getNext()
|
protected 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 char |
getNextChar(java.lang.String errorMsg)
|
protected char |
getNextCharAfterWS(java.lang.String errorMsg)
|
protected char |
getNextCharFromCurrent(java.lang.String errorMsg)
Similar to getNextChar(java.lang.String) , but will not read more characters
from parent input source(s) if the current input source doesn't
have more content. |
protected char |
getNextInCurrAfterWS(java.lang.String errorMsg)
|
protected char |
getNextInCurrAfterWS(java.lang.String errorMsg,
char c)
|
protected java.net.URL |
getSource()
|
XMLStreamLocation2 |
getStartLocation()
|
protected java.lang.String |
getSystemId()
|
protected abstract char |
handleExpandedSurrogate(char first,
char second)
Method called when a character entity needs to expand to a pair of 16-bit surrogate characters. |
protected abstract void |
handleIncompleteEntityProblem(WstxInputSource closing)
|
protected abstract 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 void |
initInputSource(WstxInputSource newInput,
boolean isExt)
Method called when an entity has been expanded (new input source has been created). |
protected int |
inputInBuffer()
|
protected boolean |
loadMore()
Method that will try to read one or more characters from currently open input sources; closing input sources if necessary. |
protected boolean |
loadMore(java.lang.String errorMsg)
|
protected boolean |
loadMoreFromCurrent()
|
protected boolean |
loadMoreFromCurrent(java.lang.String errorMsg)
|
protected void |
markLF()
|
protected void |
markLF(int inputPtr)
|
protected java.lang.String |
parseEntityName(char c)
|
protected java.lang.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 java.lang.String |
parseFullName()
Method that will parse 'full' name token; what full means depends on whether reader is namespace aware or not. |
protected java.lang.String |
parseFullName(char c)
|
protected java.lang.String |
parseFullName2(int start,
int hash)
|
protected java.lang.String |
parseLocalName(char 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 java.lang.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 java.lang.String |
parsePublicId(char quoteChar,
boolean normalize,
java.lang.String errorMsg)
Simple parsing method that parses system ids, which are generally used in entities (from DOCTYPE declaration to internal/external subsets). |
protected java.lang.String |
parseSystemId(char quoteChar,
boolean convertLFs,
java.lang.String errorMsg)
Simple parsing method that parses system ids, which are generally used in entities (from DOCTYPE declaration to internal/external subsets). |
protected void |
parseUntil(TextBuffer tb,
char endChar,
boolean convertLFs,
java.lang.String errorMsg)
|
protected int |
peekNext()
Similar to getNext() , but does not advance pointer
in input buffer. |
protected 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. |
void |
reportProblem(java.lang.String probType,
java.lang.String msg)
|
void |
reportProblem(java.lang.String probType,
java.lang.String format,
java.lang.Object arg)
|
void |
reportProblem(java.lang.String probType,
java.lang.String format,
java.lang.Object arg,
java.lang.Object arg2)
|
void |
reportProblem(java.lang.String probType,
java.lang.String format,
java.lang.Object arg,
java.lang.Object arg2,
javax.xml.stream.Location loc)
|
void |
reportValidationProblem(javax.xml.stream.Location loc,
java.lang.String msg)
|
void |
reportValidationProblem(java.lang.String msg)
|
void |
reportValidationProblem(java.lang.String msg,
int severity)
|
void |
reportValidationProblem(java.lang.String msg,
javax.xml.stream.Location loc,
int severity)
|
void |
reportValidationProblem(java.lang.String format,
java.lang.Object arg)
|
void |
reportValidationProblem(java.lang.String format,
java.lang.Object arg,
java.lang.Object arg2)
|
void |
reportValidationProblem(XMLValidationProblem prob)
Note: this is the base implementation used for implementing ValidationContext |
protected char |
resolveCharOnlyEntity(boolean 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 resolveCharOnlyEntity(boolean) ; will only resolve entity
if it is NOT a character entity (or pre-defined 'generic' entity;
amp, apos, lt, gt or quot). |
protected char |
resolveSimpleEntity(boolean 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 boolean |
skipCRLF(char c)
Method called when a CR has been spotted in input; checks if next char is LF, and if so, skips it. |
protected int |
skipFullName(char c)
Note: does not check for number of colons, amongst other things. |
protected void |
throwFromIOE(java.io.IOException ioe)
|
protected void |
throwFromStrE(javax.xml.stream.XMLStreamException strex)
|
protected void |
throwIllegalCall()
|
protected void |
throwInvalidSpace(int i)
|
protected WstxException |
throwInvalidSpace(int i,
boolean deferErrors)
|
protected void |
throwLazyError(java.lang.Exception e)
Method called to report an error, when caller's signature only allows runtime exceptions to be thrown. |
protected void |
throwNullChar()
|
protected void |
throwNullParent(WstxInputSource curr)
|
void |
throwParseError(java.lang.String msg)
Throws generic parse error with specified message and current parsing location. |
void |
throwParseError(java.lang.String format,
java.lang.Object arg)
|
void |
throwParseError(java.lang.String format,
java.lang.Object arg,
java.lang.Object arg2)
|
protected void |
throwUnexpectedChar(int i,
java.lang.String msg)
|
protected void |
throwUnexpectedEOB(java.lang.String msg)
Similar to throwUnexpectedEOF(java.lang.String) , but only indicates ending
of an input block. |
protected void |
throwUnexpectedEOF(java.lang.String msg)
|
WstxException |
throwWfcException(java.lang.String msg,
boolean deferErrors)
|
protected java.lang.String |
tokenTypeDesc(int type)
|
Methods inherited from class com.ctc.wstx.io.WstxInputData |
---|
copyBufferStateFrom, findIllegalNameChar, findIllegalNmtokenChar, getCharDesc, isNameChar, isNameChar, isNameStartChar, isNameStartChar, isSpaceChar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean SAX_COMPAT_MODE
Perhaps this should be a property that could be enabled dynamically?
public static final char CHAR_CR_LF_OR_NULL
public static final int INT_CR_LF_OR_NULL
protected static final char CHAR_FIRST_PURE_TEXT
protected static final char CHAR_LOWEST_LEGAL_LOCALNAME_CHAR
protected final ReaderConfig mConfig
protected final boolean mCfgNsEnabled
protected boolean mCfgReplaceEntities
protected boolean mCfgNormalizeLFs
Note: xml specs mandate that the line feeds are only normalized when they are from the external entities (main doc, external general/parsed entities), meaning that normalization has to be suppressed when expanding internal general/parsed entities.
protected java.lang.String mCurrName
Currently used for proc. instr. target, and entity name (at least when current entity reference is null).
Note: this variable is generally not cleared, since it comes from a symbol table, ie. this won't be the only reference.
protected WstxInputSource mInput
protected final WstxInputSource mRootInput
protected int mCurrDepth
Basically this value is compared to mInputTopDepth
, which
indicates what was the depth at the point where the currently active
input scope/block was started.
protected int mInputTopDepth
protected char[] mNameBuffer
protected long mTokenInputTotal
protected int mTokenInputRow
protected int mTokenInputCol
protected int mDocXmlVersion
XmlConsts
(like XmlConsts.XML_V_10
).
Constructor Detail |
---|
protected StreamScanner(WstxInputSource input, ReaderConfig cfg, javax.xml.stream.XMLResolver res)
Method Detail |
---|
protected WstxInputLocation getLastCharLocation()
protected java.net.URL getSource()
protected java.lang.String getSystemId()
public abstract javax.xml.stream.Location getLocation()
getLocation
in interface InputProblemReporter
public XMLStreamLocation2 getStartLocation()
public XMLStreamLocation2 getCurrentLocation()
public WstxException throwWfcException(java.lang.String msg, boolean deferErrors) throws WstxException
WstxException
public void throwParseError(java.lang.String msg) throws WstxException
Note: public access only because core code in other packages needs to access it.
throwParseError
in interface InputProblemReporter
WstxException
public void throwParseError(java.lang.String format, java.lang.Object arg) throws WstxException
throwParseError
in interface InputProblemReporter
WstxException
public void throwParseError(java.lang.String format, java.lang.Object arg, java.lang.Object arg2) throws WstxException
throwParseError
in interface InputProblemReporter
WstxException
public void reportProblem(java.lang.String probType, java.lang.String msg)
reportProblem
in interface InputProblemReporter
public void reportProblem(java.lang.String probType, java.lang.String format, java.lang.Object arg)
reportProblem
in interface InputProblemReporter
public void reportProblem(java.lang.String probType, java.lang.String format, java.lang.Object arg, java.lang.Object arg2)
reportProblem
in interface InputProblemReporter
public void reportProblem(java.lang.String probType, java.lang.String format, java.lang.Object arg, java.lang.Object arg2, javax.xml.stream.Location loc)
reportProblem
in interface InputProblemReporter
protected final void doReportProblem(javax.xml.stream.XMLReporter rep, java.lang.String probType, java.lang.String msg, javax.xml.stream.Location loc)
public void reportValidationProblem(XMLValidationProblem prob) throws XMLValidationException
Note: this is the base implementation used for implementing
ValidationContext
reportValidationProblem
in interface InputProblemReporter
XMLValidationException
public void reportValidationProblem(java.lang.String msg, javax.xml.stream.Location loc, int severity) throws XMLValidationException
reportValidationProblem
in interface InputProblemReporter
XMLValidationException
public void reportValidationProblem(java.lang.String msg, int severity) throws XMLValidationException
XMLValidationException
public void reportValidationProblem(java.lang.String msg) throws XMLValidationException
reportValidationProblem
in interface InputProblemReporter
XMLValidationException
public void reportValidationProblem(javax.xml.stream.Location loc, java.lang.String msg) throws XMLValidationException
XMLValidationException
public void reportValidationProblem(java.lang.String format, java.lang.Object arg) throws XMLValidationException
reportValidationProblem
in interface InputProblemReporter
XMLValidationException
public void reportValidationProblem(java.lang.String format, java.lang.Object arg, java.lang.Object arg2) throws XMLValidationException
reportValidationProblem
in interface InputProblemReporter
XMLValidationException
protected WstxException constructWfcException(java.lang.String msg)
protected WstxException constructFromIoe(java.io.IOException ioe)
protected WstxException constructNullCharException()
protected void throwUnexpectedChar(int i, java.lang.String msg) throws WstxException
WstxException
protected void throwNullChar() throws WstxException
WstxException
protected void throwInvalidSpace(int i) throws WstxException
WstxException
protected WstxException throwInvalidSpace(int i, boolean deferErrors) throws WstxException
WstxException
protected void throwUnexpectedEOF(java.lang.String msg) throws WstxException
WstxException
protected void throwUnexpectedEOB(java.lang.String msg) throws WstxException
throwUnexpectedEOF(java.lang.String)
, but only indicates ending
of an input block. Used when reading a token that can not span
input block boundaries (ie. can not continue past end of an
entity expansion).
WstxException
protected void throwFromIOE(java.io.IOException ioe) throws WstxException
WstxException
protected void throwFromStrE(javax.xml.stream.XMLStreamException strex) throws WstxException
WstxException
protected void throwLazyError(java.lang.Exception e)
protected java.lang.String tokenTypeDesc(int type)
public final WstxInputSource getCurrentInput()
Note: public only because some implementations are on different package.
protected final int inputInBuffer()
protected final int getNext() throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final int peekNext() throws java.io.IOException, javax.xml.stream.XMLStreamException
getNext()
, but does not advance pointer
in input buffer.
Note: this method only peeks within current input source; it does not close it and check nested input source (if any). This is necessary when checking keywords, since they can never cross input block boundary.
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char getNextChar(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char getNextCharFromCurrent(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
getNextChar(java.lang.String)
, but will not read more characters
from parent input source(s) if the current input source doesn't
have more content. This is often needed to prevent "runaway" content,
such as comments that start in an entity but do not have matching
close marker inside entity; XML specification specifically states
such markup is not legal.
java.io.IOException
javax.xml.stream.XMLStreamException
protected final int getNextAfterWS() throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char getNextCharAfterWS(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char getNextInCurrAfterWS(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char getNextInCurrAfterWS(java.lang.String errorMsg, char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final boolean skipCRLF(char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final void markLF()
protected final void markLF(int inputPtr)
protected final void pushback()
protected void initInputSource(WstxInputSource newInput, boolean isExt) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected boolean loadMore() throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final boolean loadMore(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected boolean loadMoreFromCurrent() throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final boolean loadMoreFromCurrent(java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected boolean ensureInput(int minAmount) throws java.io.IOException
loadMore()
. It can only be called
when input comes from main-level buffer; further, call can shift
content in input buffer, so caller has to flush any data still
pending. In short, caller has to know exactly what it's doing. :-)
Note: method does not check for any other input sources than the current one -- if current source can not fulfill the request, a failure is indicated.
java.io.IOException
protected void closeAllInput(boolean force) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void throwNullParent(WstxInputSource curr)
protected char resolveSimpleEntity(boolean checkStd) throws javax.xml.stream.XMLStreamException
Note: On entry we are guaranteed there are at least 3 more characters in this buffer; otherwise we shouldn't be called.
checkStd
- If true, will check pre-defined internal entities
(gt, lt, amp, apos, quot); if false, will only check actual
character entities.
javax.xml.stream.XMLStreamException
protected char resolveCharOnlyEntity(boolean checkStd) throws java.io.IOException, javax.xml.stream.XMLStreamException
Most often this method is called when reader is not to expand non-char entities automatically, but to return them as separate events.
Main complication here is that we need to do 5-char lookahead. This is problematic if chars are on input buffer boundary. This is ok for the root level input buffer, but not for some nested buffers. However, according to XML specs, such split entities are actually illegal... so we can throw an exception in those cases.
checkStd
- 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.
java.io.IOException
javax.xml.stream.XMLStreamException
protected EntityDecl resolveNonCharEntity() throws java.io.IOException, javax.xml.stream.XMLStreamException
resolveCharOnlyEntity(boolean)
; will only resolve entity
if it is NOT a character entity (or pre-defined 'generic' entity;
amp, apos, lt, gt or quot). Only used in cases where entities
are to be separately returned unexpanded (in non-entity-replacing
mode); which means it's never called from dtd handler.
java.io.IOException
javax.xml.stream.XMLStreamException
protected char fullyResolveEntity(boolean allowExt) throws java.io.IOException, javax.xml.stream.XMLStreamException
allowExt
- If true, is allowed to expand external entities
(expanding text); if false, is not (expanding attribute value).
java.io.IOException
javax.xml.stream.XMLStreamException
protected EntityDecl expandEntity(java.lang.String id, boolean allowExt, java.lang.Object extraArg) throws java.io.IOException, javax.xml.stream.XMLStreamException
note: called by sub-classes (dtd parser), needs to be protected.
id
- Name of the entity being expandedallowExt
- Whether external entities can be expanded or not; if
not, and the entity to expand would be external one, an exception
will be thrown
java.io.IOException
javax.xml.stream.XMLStreamException
protected abstract EntityDecl findEntity(java.lang.String id, java.lang.Object arg) throws javax.xml.stream.XMLStreamException
id
- Identifier of the entity to findarg
- Optional argument passed from caller; needed by DTD
reader.
javax.xml.stream.XMLStreamException
protected abstract void handleUndeclaredEntity(java.lang.String id) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected abstract void handleIncompleteEntityProblem(WstxInputSource closing) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected abstract char handleExpandedSurrogate(char first, char second)
protected java.lang.String parseLocalName(char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
Much of complexity in this method has to do with the intention to try to avoid any character copies. In this optimal case algorithm would be fairly simple. However, this only works if all data is already in input buffer... if not, copy has to be made halfway through parsing, and that complicates things.
One thing to note is that String returned has been canonicalized and (if necessary) added to symbol table. It can thus be compared against other such (usually id) Strings, with simple equality operator.
c
- First character of the name; not yet checked for validity
java.io.IOException
javax.xml.stream.XMLStreamException
protected java.lang.String parseLocalName2(int start, int hash) throws java.io.IOException, javax.xml.stream.XMLStreamException
Note that this isn't heavily optimized, on assumption it's not called very often.
java.io.IOException
javax.xml.stream.XMLStreamException
protected java.lang.String parseFullName() throws java.io.IOException, javax.xml.stream.XMLStreamException
Similar to parseLocalName(char)
, much of complexity stems from
trying to avoid copying name characters from input buffer.
Note that returned String will be canonicalized, similar to
parseLocalName(char)
, but without separating prefix/local name.
java.io.IOException
javax.xml.stream.XMLStreamException
protected java.lang.String parseFullName(char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected java.lang.String parseFullName2(int start, int hash) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected java.lang.String parseFNameForError() throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final java.lang.String parseEntityName(char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected int skipFullName(char c) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final java.lang.String parseSystemId(char quoteChar, boolean convertLFs, java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
NOTE: returned String is not canonicalized, on assumption that
external ids may be longish, and are not shared all that often, as
they are generally just used for resolving paths, if anything.
Also note that this method is not heavily optimized, as it's not
likely to be a bottleneck for parsing.
java.io.IOException
javax.xml.stream.XMLStreamException
protected final java.lang.String parsePublicId(char quoteChar, boolean normalize, java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
As per xml specs, the contents are actually normalized.
NOTE: returned String is not canonicalized, on assumption that
external ids may be longish, and are not shared all that often, as
they are generally just used for resolving paths, if anything.
Also note that this method is not heavily optimized, as it's not
likely to be a bottleneck for parsing.
normalize
- If true, will concatenate all white space into
a single space char (as per xml specs); if false, will leave
it as is (for 100% round trip)
java.io.IOException
javax.xml.stream.XMLStreamException
protected final void parseUntil(TextBuffer tb, char endChar, boolean convertLFs, java.lang.String errorMsg) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected final char[] getNameBuffer(int minSize)
protected final char[] expandBy50Pct(char[] buf)
protected void throwIllegalCall() throws java.lang.Error
java.lang.Error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |