com.ctc.wstx.io
Class InputBootstrapper
java.lang.Object
com.ctc.wstx.io.InputBootstrapper
- Direct Known Subclasses:
- ReaderBootstrapper, StreamBootstrapper
- public abstract class InputBootstrapper
- extends java.lang.Object
Abstract base class that defines common API used with both stream and
reader-based input sources. Class is responsible for opening the physical
input source, figure out encoding (if necessary; only for streams), and
then handle (optional) XML declaration.
|
Constructor Summary |
protected |
InputBootstrapper(java.lang.String pubId,
java.lang.String sysId)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ERR_XMLDECL_KW_VERSION
protected static final java.lang.String ERR_XMLDECL_KW_VERSION
- See Also:
- Constant Field Values
ERR_XMLDECL_KW_ENCODING
protected static final java.lang.String ERR_XMLDECL_KW_ENCODING
- See Also:
- Constant Field Values
ERR_XMLDECL_KW_STANDALONE
protected static final java.lang.String ERR_XMLDECL_KW_STANDALONE
- See Also:
- Constant Field Values
ERR_XMLDECL_END_MARKER
protected static final java.lang.String ERR_XMLDECL_END_MARKER
- See Also:
- Constant Field Values
ERR_XMLDECL_EXP_SPACE
protected static final java.lang.String ERR_XMLDECL_EXP_SPACE
- See Also:
- Constant Field Values
ERR_XMLDECL_EXP_EQ
protected static final java.lang.String ERR_XMLDECL_EXP_EQ
- See Also:
- Constant Field Values
ERR_XMLDECL_EXP_ATTRVAL
protected static final java.lang.String ERR_XMLDECL_EXP_ATTRVAL
- See Also:
- Constant Field Values
CHAR_NULL
public static final char CHAR_NULL
- See Also:
- Constant Field Values
CHAR_SPACE
public static final char CHAR_SPACE
- See Also:
- Constant Field Values
CHAR_CR
public static final byte CHAR_CR
- See Also:
- Constant Field Values
CHAR_LF
public static final byte CHAR_LF
- See Also:
- Constant Field Values
BYTE_NULL
public static final byte BYTE_NULL
- See Also:
- Constant Field Values
BYTE_CR
public static final byte BYTE_CR
- See Also:
- Constant Field Values
BYTE_LF
public static final byte BYTE_LF
- See Also:
- Constant Field Values
mPublicId
protected final java.lang.String mPublicId
mSystemId
protected final java.lang.String mSystemId
mInputProcessed
protected int mInputProcessed
- Current number of characters that were processed in previous blocks,
before contents of current input buffer.
mInputRow
protected int mInputRow
- Current row location of current point in input buffer, starting
from 1
mInputRowStart
protected int mInputRowStart
- Current index of the first character of the current row in input
buffer. Needed to calculate column position, if necessary; benefit
of not having column itself is that this only has to be updated
once per line.
InputBootstrapper
protected InputBootstrapper(java.lang.String pubId,
java.lang.String sysId)
bootstrapInput
public abstract java.io.Reader bootstrapInput(boolean mainDoc,
javax.xml.stream.XMLReporter rep)
throws java.io.IOException,
WstxException
- Throws:
java.io.IOException
WstxException
getPublicId
public java.lang.String getPublicId()
getSystemId
public java.lang.String getSystemId()
getVersion
public java.lang.String getVersion()
getStandalone
public java.lang.String getStandalone()
getDeclaredEncoding
public java.lang.String getDeclaredEncoding()
- Returns:
- Encoding declaration found from the xml declaration, if any;
null if none.
getInputTotal
public abstract int getInputTotal()
- Returns:
- Total number of characters read from bootstrapped input
(stream, reader)
getInputRow
public int getInputRow()
getInputColumn
public abstract int getInputColumn()
getAppEncoding
public abstract java.lang.String getAppEncoding()
- Returns:
- Application specified input-encoding used, if any; null
if no information was passed.
readXmlDecl
protected void readXmlDecl(boolean isMainDoc)
throws java.io.IOException,
WstxException
- Throws:
java.io.IOException
WstxException
pushback
protected abstract void pushback()
getNext
protected abstract int getNext()
throws java.io.IOException,
WstxException
- Throws:
java.io.IOException
WstxException
getNextAfterWs
protected abstract int getNextAfterWs(boolean reqWs)
throws java.io.IOException,
WstxException
- Throws:
java.io.IOException
WstxException
checkKeyword
protected abstract int checkKeyword(java.lang.String exp)
throws java.io.IOException,
WstxException
- Returns:
- First character that does not match expected, if any;
CHAR_NULL if match succeeded
- Throws:
java.io.IOException
WstxException
readQuotedValue
protected abstract int readQuotedValue(char[] kw,
int quoteChar,
boolean norm)
throws java.io.IOException,
WstxException
- Throws:
java.io.IOException
WstxException
getLocation
protected abstract javax.xml.stream.Location getLocation()
reportNull
protected void reportNull()
throws WstxException
- Throws:
WstxException
reportXmlProblem
protected void reportXmlProblem(java.lang.String msg)
throws WstxException
- Throws:
WstxException
reportUnexpectedChar
protected void reportUnexpectedChar(int i,
java.lang.String msg)
throws WstxException
- Throws:
WstxException