public final class ReaderBootstrapper extends InputBootstrapper
Note: since the actual Reader to use after bootstrapping is pre-constructed, the local input buffer can (and should) be quite small.
| Modifier and Type | Field and Description |
|---|---|
(package private) static char |
CHAR_BOM_MARKER |
private char[] |
mCharBuffer |
(package private) java.io.Reader |
mIn
Underlying Reader to use for reading content.
|
(package private) java.lang.String |
mInputEncoding
Encoding identifier processing application passed in; if not null,
will be compared to actual xml declaration based encoding (if
declaration found)
|
private int |
mInputEnd |
private int |
mInputPtr |
BYTE_CR, BYTE_LF, BYTE_NULL, CHAR_CR, CHAR_LF, CHAR_NEL, CHAR_NULL, CHAR_SPACE, ERR_XMLDECL_END_MARKER, ERR_XMLDECL_EXP_ATTRVAL, ERR_XMLDECL_EXP_EQ, ERR_XMLDECL_EXP_SPACE, ERR_XMLDECL_KW_ENCODING, ERR_XMLDECL_KW_STANDALONE, ERR_XMLDECL_KW_VERSION, mDeclaredXmlVersion, mFoundEncoding, mInputProcessed, mInputRow, mInputRowStart, mKeyword, mPublicId, mStandalone, mSystemId, mXml11Handling| Modifier | Constructor and Description |
|---|---|
private |
ReaderBootstrapper(java.lang.String pubId,
SystemId sysId,
java.io.Reader r,
java.lang.String appEncoding) |
| Modifier and Type | Method and Description |
|---|---|
java.io.Reader |
bootstrapInput(ReaderConfig cfg,
boolean mainDoc,
int xmlVersion)
Method called to do actual bootstrapping.
|
protected int |
checkKeyword(java.lang.String exp) |
int |
getInputColumn() |
java.lang.String |
getInputEncoding()
Actual character encoding used by the underlying input source;
may have been passed by the application, or auto-detected
by byte stream boot strapper (can not be determined from a
Reader source).
|
int |
getInputTotal() |
static ReaderBootstrapper |
getInstance(java.lang.String pubId,
SystemId sysId,
java.io.Reader r,
java.lang.String appEncoding) |
protected javax.xml.stream.Location |
getLocation() |
protected int |
getNext() |
protected int |
getNextAfterWs(boolean reqWs) |
protected boolean |
initialLoad(int minimum) |
protected void |
loadMore() |
protected char |
nextChar() |
protected void |
pushback() |
protected int |
readQuotedValue(char[] kw,
int quoteChar) |
protected void |
skipCRLF(char lf) |
protected void |
verifyXmlEncoding(ReaderConfig cfg) |
declaredXml11, getDeclaredEncoding, getDeclaredVersion, getInputRow, getPublicId, getStandalone, getSystemId, initFrom, readXmlDecl, reportNull, reportUnexpectedChar, reportXmlProblemstatic final char CHAR_BOM_MARKER
final java.io.Reader mIn
final java.lang.String mInputEncoding
private char[] mCharBuffer
private int mInputPtr
private int mInputEnd
private ReaderBootstrapper(java.lang.String pubId,
SystemId sysId,
java.io.Reader r,
java.lang.String appEncoding)
public static ReaderBootstrapper getInstance(java.lang.String pubId, SystemId sysId, java.io.Reader r, java.lang.String appEncoding)
r - Eventual reader that will be reading actual content, after
bootstrapping finishesappEncoding - Encoding that application declared; may be null.
If not null, will be compared to actual declaration found; and
incompatibility reported as a potential (but not necessarily fatal)
problem.public java.io.Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion) throws java.io.IOException, javax.xml.stream.XMLStreamException
bootstrapInput in class InputBootstrapperxmlVersion - Optional xml version identifier of the main parsed
document (if not bootstrapping the main document).
Currently only relevant for checking that XML 1.0 document does not
include XML 1.1 external parsed entities.
If null, no checks will be done; when bootstrapping parsing of the
main document, null should be passed for this argument.java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic java.lang.String getInputEncoding()
InputBootstrappergetInputEncoding in class InputBootstrapperpublic int getInputTotal()
getInputTotal in class InputBootstrapperpublic int getInputColumn()
getInputColumn in class InputBootstrapperprotected void verifyXmlEncoding(ReaderConfig cfg) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionprotected boolean initialLoad(int minimum)
throws java.io.IOException
java.io.IOExceptionprotected void loadMore()
throws java.io.IOException,
WstxException
java.io.IOExceptionWstxExceptionprotected void pushback()
pushback in class InputBootstrapperprotected int getNext()
throws java.io.IOException,
WstxException
getNext in class InputBootstrapperjava.io.IOExceptionWstxExceptionprotected int getNextAfterWs(boolean reqWs)
throws java.io.IOException,
WstxException
getNextAfterWs in class InputBootstrapperjava.io.IOExceptionWstxExceptionprotected int checkKeyword(java.lang.String exp)
throws java.io.IOException,
WstxException
checkKeyword in class InputBootstrapperjava.io.IOExceptionWstxExceptionprotected int readQuotedValue(char[] kw,
int quoteChar)
throws java.io.IOException,
WstxException
readQuotedValue in class InputBootstrapperjava.io.IOExceptionWstxExceptionprotected javax.xml.stream.Location getLocation()
getLocation in class InputBootstrapperprotected char nextChar()
throws java.io.IOException,
WstxException
java.io.IOExceptionWstxExceptionprotected void skipCRLF(char lf)
throws java.io.IOException,
WstxException
java.io.IOExceptionWstxException