public abstract class InputBootstrapper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
BYTE_CR |
static byte |
BYTE_LF |
static byte |
BYTE_NULL |
static byte |
CHAR_CR |
static byte |
CHAR_LF |
static char |
CHAR_NEL |
static char |
CHAR_NULL |
static char |
CHAR_SPACE |
protected static java.lang.String |
ERR_XMLDECL_END_MARKER |
protected static java.lang.String |
ERR_XMLDECL_EXP_ATTRVAL |
protected static java.lang.String |
ERR_XMLDECL_EXP_EQ |
protected static java.lang.String |
ERR_XMLDECL_EXP_SPACE |
protected static java.lang.String |
ERR_XMLDECL_KW_ENCODING |
protected static java.lang.String |
ERR_XMLDECL_KW_STANDALONE |
protected static java.lang.String |
ERR_XMLDECL_KW_VERSION |
(package private) int |
mDeclaredXmlVersion
XML declaration from the input (1.0, 1.1 or 'unknown')
|
(package private) java.lang.String |
mFoundEncoding
Value of encoding pseudo-attribute from xml declaration, if
one was found; null otherwise.
|
protected int |
mInputProcessed
Current number of characters that were processed in previous blocks,
before contents of current input buffer.
|
protected int |
mInputRow
Current row location of current point in input buffer, starting
from 1
|
protected int |
mInputRowStart
Current index of the first character of the current row in input
buffer.
|
(package private) char[] |
mKeyword
Need a short buffer to read in values of pseudo-attributes (version,
encoding, standalone).
|
protected java.lang.String |
mPublicId |
(package private) java.lang.String |
mStandalone |
protected SystemId |
mSystemId |
(package private) boolean |
mXml11Handling
Flag that indicates whether input read from this input source
needs to be xml 1.1 compliant or not; if not, xml 1.0 is assumed.
|
Modifier | Constructor and Description |
---|---|
protected |
InputBootstrapper(java.lang.String pubId,
SystemId sysId) |
Modifier and Type | Method and Description |
---|---|
abstract java.io.Reader |
bootstrapInput(ReaderConfig cfg,
boolean mainDoc,
int xmlVersion) |
protected abstract int |
checkKeyword(java.lang.String exp) |
boolean |
declaredXml11() |
java.lang.String |
getDeclaredEncoding() |
int |
getDeclaredVersion() |
abstract int |
getInputColumn() |
abstract 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 |
getInputRow() |
abstract int |
getInputTotal() |
protected abstract javax.xml.stream.Location |
getLocation() |
protected abstract int |
getNext() |
protected abstract int |
getNextAfterWs(boolean reqWs) |
java.lang.String |
getPublicId() |
java.lang.String |
getStandalone() |
SystemId |
getSystemId() |
private int |
getWsOrChar(int ok)
Method that should get next character, which has to be either specified
character (usually end marker), OR, any character as long as there'
at least one space character before it.
|
private int |
handleEq(java.lang.String attr) |
protected void |
initFrom(InputBootstrapper src) |
protected abstract void |
pushback() |
protected abstract int |
readQuotedValue(char[] kw,
int quoteChar) |
protected void |
readXmlDecl(boolean isMainDoc,
int xmlVersion) |
private java.lang.String |
readXmlEncoding() |
private java.lang.String |
readXmlStandalone() |
private int |
readXmlVersion() |
protected void |
reportNull() |
private void |
reportPseudoAttrProblem(java.lang.String attrName,
java.lang.String got,
java.lang.String expVal1,
java.lang.String expVal2) |
protected void |
reportUnexpectedChar(int i,
java.lang.String msg) |
protected void |
reportXmlProblem(java.lang.String msg) |
protected static final java.lang.String ERR_XMLDECL_KW_VERSION
protected static final java.lang.String ERR_XMLDECL_KW_ENCODING
protected static final java.lang.String ERR_XMLDECL_KW_STANDALONE
protected static final java.lang.String ERR_XMLDECL_END_MARKER
protected static final java.lang.String ERR_XMLDECL_EXP_SPACE
protected static final java.lang.String ERR_XMLDECL_EXP_EQ
protected static final java.lang.String ERR_XMLDECL_EXP_ATTRVAL
public static final char CHAR_NULL
public static final char CHAR_SPACE
public static final char CHAR_NEL
public static final byte CHAR_CR
public static final byte CHAR_LF
public static final byte BYTE_NULL
public static final byte BYTE_CR
public static final byte BYTE_LF
protected final java.lang.String mPublicId
protected final SystemId mSystemId
protected int mInputProcessed
protected int mInputRow
protected int mInputRowStart
int mDeclaredXmlVersion
java.lang.String mFoundEncoding
java.lang.String mStandalone
boolean mXml11Handling
final char[] mKeyword
protected InputBootstrapper(java.lang.String pubId, SystemId sysId)
protected void initFrom(InputBootstrapper src)
public abstract java.io.Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion) throws java.io.IOException, javax.xml.stream.XMLStreamException
xmlVersion
- 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.IOException
javax.xml.stream.XMLStreamException
public java.lang.String getPublicId()
public SystemId getSystemId()
public int getDeclaredVersion()
public boolean declaredXml11()
public java.lang.String getStandalone()
public java.lang.String getDeclaredEncoding()
public abstract int getInputTotal()
public int getInputRow()
public abstract int getInputColumn()
public abstract java.lang.String getInputEncoding()
protected void readXmlDecl(boolean isMainDoc, int xmlVersion) throws java.io.IOException, WstxException
xmlVersion
- 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.IOException
WstxException
private final int readXmlVersion() throws java.io.IOException, WstxException
java.io.IOException
WstxException
private final java.lang.String readXmlEncoding() throws java.io.IOException, WstxException
java.io.IOException
WstxException
private final java.lang.String readXmlStandalone() throws java.io.IOException, WstxException
java.io.IOException
WstxException
private final int handleEq(java.lang.String attr) throws java.io.IOException, WstxException
java.io.IOException
WstxException
private final int getWsOrChar(int ok) throws java.io.IOException, WstxException
java.io.IOException
WstxException
protected abstract void pushback()
protected abstract int getNext() throws java.io.IOException, WstxException
java.io.IOException
WstxException
protected abstract int getNextAfterWs(boolean reqWs) throws java.io.IOException, WstxException
java.io.IOException
WstxException
protected abstract int checkKeyword(java.lang.String exp) throws java.io.IOException, WstxException
java.io.IOException
WstxException
protected abstract int readQuotedValue(char[] kw, int quoteChar) throws java.io.IOException, WstxException
java.io.IOException
WstxException
protected abstract javax.xml.stream.Location getLocation()
protected void reportNull() throws WstxException
WstxException
protected void reportXmlProblem(java.lang.String msg) throws WstxException
WstxException
protected void reportUnexpectedChar(int i, java.lang.String msg) throws WstxException
WstxException
private final void reportPseudoAttrProblem(java.lang.String attrName, java.lang.String got, java.lang.String expVal1, java.lang.String expVal2) throws WstxException
WstxException