public final class StreamBootstrapper extends InputBootstrapper
Encoding used for an entity (including main document entity) is determined using algorithms suggested in XML 1.0#3 spec, appendix F
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, mKeywordBuffer, mPublicId, mStandalone, mSystemId, mXml11Handling| Modifier and Type | Method and Description |
|---|---|
Reader |
bootstrapInput(ReaderConfig cfg,
boolean mainDoc,
int xmlVersion) |
protected int |
checkKeyword(String exp) |
protected int |
checkMbKeyword(String expected) |
protected int |
checkSbKeyword(String expected) |
protected int |
checkTranslatedKeyword(String expected) |
protected boolean |
ensureLoaded(int minimum) |
int |
getInputColumn() |
String |
getInputEncoding()
Since this class only gets used when encoding is not explicitly
passed, need use the encoding that was auto-detected...
|
int |
getInputTotal() |
static StreamBootstrapper |
getInstance(String pubId,
SystemId sysId,
byte[] data,
int start,
int end)
Factory method used when the underlying data provider is a pre-allocated
block source, and no stream is used.
|
static StreamBootstrapper |
getInstance(String pubId,
SystemId sysId,
InputStream in)
Factory method used when the underlying data provider is an
actual stream.
|
protected Location |
getLocation() |
protected int |
getNext() |
protected int |
getNextAfterWs(boolean reqWs) |
protected boolean |
hasXmlDecl() |
protected void |
loadMore() |
protected byte |
nextByte() |
protected int |
nextMultiByte() |
protected int |
nextTranslated() |
protected void |
pushback() |
protected int |
readQuotedValue(char[] outputBuffer,
int quoteChar) |
protected void |
resolveStreamEncoding()
Method called to try to figure out physical encoding the underlying
input stream uses.
|
protected void |
skipMbLF(int lf) |
protected int |
skipMbWs() |
protected void |
skipSbLF(byte lfByte) |
protected int |
skipSbWs() |
protected void |
skipTranslatedLF(int lf) |
protected int |
skipTranslatedWs() |
protected String |
verifyXmlEncoding(String enc) |
declaredXml11, getDeclaredEncoding, getDeclaredVersion, getInputRow, getPublicId, getStandalone, getSystemId, initFrom, readXmlDecl, reportNull, reportUnexpectedChar, reportXmlProblempublic static StreamBootstrapper getInstance(String pubId, SystemId sysId, InputStream in)
public static StreamBootstrapper getInstance(String pubId, SystemId sysId, byte[] data, int start, int end)
public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion) throws IOException, 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.IOExceptionXMLStreamExceptionpublic String getInputEncoding()
getInputEncoding in class InputBootstrapperpublic int getInputTotal()
getInputTotal in class InputBootstrapperpublic int getInputColumn()
getInputColumn in class InputBootstrapperprotected void resolveStreamEncoding()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected String verifyXmlEncoding(String enc) throws WstxException
WstxExceptionprotected boolean ensureLoaded(int minimum)
throws IOException
IOExceptionprotected void loadMore()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected void pushback()
pushback in class InputBootstrapperprotected int getNext()
throws IOException,
WstxException
getNext in class InputBootstrapperIOExceptionWstxExceptionprotected int getNextAfterWs(boolean reqWs)
throws IOException,
WstxException
getNextAfterWs in class InputBootstrapperIOExceptionWstxExceptionprotected int checkKeyword(String exp) throws IOException, WstxException
checkKeyword in class InputBootstrapperIOExceptionWstxExceptionprotected int readQuotedValue(char[] outputBuffer,
int quoteChar)
throws IOException,
WstxException
readQuotedValue in class InputBootstrapperIOExceptionWstxExceptionprotected boolean hasXmlDecl()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected Location getLocation()
getLocation in class InputBootstrapperprotected byte nextByte()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int skipSbWs()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected void skipSbLF(byte lfByte)
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int checkSbKeyword(String expected) throws IOException, WstxException
IOExceptionWstxExceptionprotected int nextMultiByte()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int nextTranslated()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int skipMbWs()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int skipTranslatedWs()
throws IOException,
WstxException
IOExceptionWstxExceptionprotected void skipMbLF(int lf)
throws IOException,
WstxException
IOExceptionWstxExceptionprotected void skipTranslatedLF(int lf)
throws IOException,
WstxException
IOExceptionWstxExceptionprotected int checkMbKeyword(String expected) throws IOException, WstxException
IOExceptionWstxExceptionprotected int checkTranslatedKeyword(String expected) throws IOException, WstxException
IOExceptionWstxExceptionCopyright © 2022 FasterXML. All rights reserved.