Class InputBootstrapper
java.lang.Object
com.fasterxml.aalto.in.InputBootstrapper
- All Implemented Interfaces:
XmlConsts
- Direct Known Subclasses:
ByteSourceBootstrapper, CharSourceBootstrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intCurrent number of input units (bytes or chars) that were processed in previous blocks, before contents of current input buffer.protected intCurrent row location of current point in input buffer, using zero-based counting.protected intCurrent index of the first character of the current row in input buffer.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract XmlScannerMain 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 abstract intcheckKeyword(String exp) protected abstract Locationprotected abstract intgetNext()protected abstract intgetNextAfterWs(boolean reqWs) protected abstract voidpushback()protected abstract intreadQuotedValue(char[] kw, int quoteChar) protected voidMethod that will parse xml declaration, which at this point is known to exist.protected voidprotected voidprotected final voidreportPseudoAttrProblem(String attrName, String got, String expVal1, String expVal2) protected voidreportUnexpectedChar(int i, String msg) protected voidreportXmlProblem(String msg)
-
Field Details
-
ERR_XMLDECL_KW_VERSION
- See Also:
-
ERR_XMLDECL_KW_ENCODING
- See Also:
-
ERR_XMLDECL_KW_STANDALONE
- See Also:
-
ERR_XMLDECL_END_MARKER
- See Also:
-
ERR_XMLDECL_EXP_SPACE
- See Also:
-
ERR_XMLDECL_EXP_EQ
- See Also:
-
ERR_XMLDECL_EXP_ATTRVAL
- See Also:
-
_inputProcessed
protected int _inputProcessedCurrent number of input units (bytes or chars) that were processed in previous blocks, before contents of current input buffer.Note: includes possible BOMs, if those were part of the input.
-
_inputRow
protected int _inputRowCurrent row location of current point in input buffer, using zero-based counting. -
_inputRowStart
protected int _inputRowStartCurrent 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.
-
-
Constructor Details
-
InputBootstrapper
-
-
Method Details
-
bootstrap
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.- Throws:
XMLStreamException
-
readXmlDeclaration
Method that will parse xml declaration, which at this point is known to exist.- Throws:
IOExceptionXMLStreamException
-
pushback
protected abstract void pushback() -
getNext
- Throws:
IOExceptionXMLStreamException
-
getNextAfterWs
- Throws:
IOExceptionXMLStreamException
-
checkKeyword
- Returns:
- First character that does not match expected, if any; CHAR_NULL if match succeeded
- Throws:
IOExceptionXMLStreamException
-
readQuotedValue
protected abstract int readQuotedValue(char[] kw, int quoteChar) throws IOException, XMLStreamException - Throws:
IOExceptionXMLStreamException
-
getLocation
-
reportXmlProblem
- Throws:
XMLStreamException
-
reportNull
- Throws:
XMLStreamException
-
reportEof
- Throws:
XMLStreamException
-
reportUnexpectedChar
- Throws:
XMLStreamException
-
reportPseudoAttrProblem
protected final void reportPseudoAttrProblem(String attrName, String got, String expVal1, String expVal2) throws XMLStreamException - Throws:
XMLStreamException
-