Package com.fasterxml.aalto.in
Class CharSourceBootstrapper
java.lang.Object
com.fasterxml.aalto.in.InputBootstrapper
com.fasterxml.aalto.in.CharSourceBootstrapper
- All Implemented Interfaces:
XmlConsts
Class that takes care of bootstrapping main document input from
a Stream input source.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Reader
Underlying Reader to use for reading content.(package private) final char[]
private int
Offset of the first character after the end of valid buffer contents.private int
(package private) static final char
(package private) static final int
Whether to use a bigger (4000, ie.Fields inherited from class com.fasterxml.aalto.in.InputBootstrapper
_config, _inputProcessed, _inputRow, _inputRowStart, 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, mKeyword, mStandalone
Fields inherited from interface com.fasterxml.aalto.util.XmlConsts
CHAR_CR, CHAR_LF, CHAR_NULL, CHAR_SPACE, MAX_UNICODE_CHAR, STAX_DEFAULT_OUTPUT_ENCODING, STAX_DEFAULT_OUTPUT_VERSION, XML_DECL_KW_ENCODING, XML_DECL_KW_STANDALONE, XML_DECL_KW_VERSION, XML_SA_NO, XML_SA_YES, XML_V_10, XML_V_10_STR, XML_V_11, XML_V_11_STR, XML_V_UNKNOWN
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CharSourceBootstrapper
(ReaderConfig cfg, char[] buffer, int start, int len) private
CharSourceBootstrapper
(ReaderConfig cfg, Reader r) -
Method Summary
Modifier and TypeMethodDescriptionfinal XmlScanner
Main bootstrapping method, which will try to open the underlying input source, check its encoding, read xml declaration if there is one, and finally create a scanner for actual parsing.protected int
checkKeyword
(String exp) static CharSourceBootstrapper
construct
(ReaderConfig cfg, char[] buffer, int start, int len) static CharSourceBootstrapper
construct
(ReaderConfig cfg, Reader r) protected Location
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 String
verifyXmlEncoding
(String enc) Methods inherited from class com.fasterxml.aalto.in.InputBootstrapper
readXmlDeclaration, reportEof, reportNull, reportPseudoAttrProblem, reportUnexpectedChar, reportXmlProblem
-
Field Details
-
DEFAULT_BUFFER_SIZE
static final int DEFAULT_BUFFER_SIZEWhether to use a bigger (4000, ie. 8k) or smaller (2000 -> 4k) buffer size?- See Also:
-
CHAR_BOM_MARKER
static final char CHAR_BOM_MARKER- See Also:
-
_in
Underlying Reader to use for reading content. -
_inputBuffer
final char[] _inputBuffer -
_inputPtr
private int _inputPtr -
_inputLast
private int _inputLastOffset of the first character after the end of valid buffer contents.
-
-
Constructor Details
-
CharSourceBootstrapper
-
CharSourceBootstrapper
-
-
Method Details
-
construct
public static CharSourceBootstrapper construct(ReaderConfig cfg, Reader r) throws XMLStreamException - Throws:
XMLStreamException
-
construct
public static CharSourceBootstrapper construct(ReaderConfig cfg, char[] buffer, int start, int len) throws XMLStreamException - Throws:
XMLStreamException
-
bootstrap
Description copied from class:InputBootstrapper
Main bootstrapping method, which will try to open the underlying input source, check its encoding, read xml declaration if there is one, and finally create a scanner for actual parsing.- Specified by:
bootstrap
in classInputBootstrapper
- Throws:
XMLStreamException
-
doBootstrap
- Throws:
IOException
XMLStreamException
-
verifyXmlEncoding
- Returns:
- Normalized encoding name
- Throws:
XMLStreamException
-
initialLoad
- Throws:
IOException
-
loadMore
- Throws:
IOException
XMLStreamException
-
pushback
protected void pushback()- Specified by:
pushback
in classInputBootstrapper
-
getNext
- Specified by:
getNext
in classInputBootstrapper
- Throws:
IOException
XMLStreamException
-
getNextAfterWs
- Specified by:
getNextAfterWs
in classInputBootstrapper
- Throws:
IOException
XMLStreamException
-
checkKeyword
- Specified by:
checkKeyword
in classInputBootstrapper
- Returns:
- First character that does not match expected, if any; CHAR_NULL if match succeeded
- Throws:
IOException
XMLStreamException
-
readQuotedValue
- Specified by:
readQuotedValue
in classInputBootstrapper
- Throws:
IOException
XMLStreamException
-
getLocation
- Specified by:
getLocation
in classInputBootstrapper
-
nextChar
- Throws:
IOException
XMLStreamException
-
skipCRLF
- Throws:
IOException
XMLStreamException
-