Top Description Fields Constructors Methods
com.fasterxml.aalto.in

public final Class CharSourceBootstrapper

extends InputBootstrapper
Class Inheritance
Imports
java.io.*, java.text.MessageFormat, javax.xml.stream.Location, .XMLReporter, .XMLStreamException, com.fasterxml.aalto.impl.ErrorConsts, .IoStreamException, .LocationImpl, com.fasterxml.aalto.util.CharsetNames

Class that takes care of bootstrapping main document input from a Stream input source.

Field Summary

Modifier and TypeField and Description
pack-priv final Reader
_in

Underlying Reader to use for reading content.

pack-priv final char[]
private int
_inputLast

Offset of the first character after the end of valid buffer contents.

private int
pack-priv static final char
pack-priv static final int
DEFAULT_BUFFER_SIZE

Whether to use a bigger (4000, ie.

Inherited from com.fasterxml.aalto.in.InputBootstrapper:
_config_inputProcessed_inputRow_inputRowStartERR_XMLDECL_END_MARKERERR_XMLDECL_EXP_ATTRVALERR_XMLDECL_EXP_EQERR_XMLDECL_EXP_SPACEERR_XMLDECL_KW_ENCODINGERR_XMLDECL_KW_STANDALONEERR_XMLDECL_KW_VERSIONmDeclaredXmlVersionmFoundEncodingmKeywordmStandalone

Constructor Summary

AccessConstructor and Description
private
private
CharSourceBootstrapper(ReaderConfig cfg, char[] buffer, int start, int len)

Method Summary

Modifier and TypeMethod and Description
public final XmlScanner
bootstrap()

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.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.
protected int

Returns:

First character that does not match expected, if any; CHAR_NULL if match succeeded
checkKeyword
(String exp)

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.checkKeyword.

public static CharSourceBootstrapper
public static CharSourceBootstrapper
construct(ReaderConfig cfg, char[] buffer, int start, int len)

public XmlScanner
protected Location
protected int
protected int
protected boolean
initialLoad(int minimum)

protected void
protected char
protected void
protected int
readQuotedValue(char[] kw, int quoteChar)

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.readQuotedValue.

protected void
skipCRLF(char lf)

protected String

Returns:

Normalized encoding name
verifyXmlEncoding
(String enc)

Inherited from com.fasterxml.aalto.in.InputBootstrapper:
readXmlDeclarationreportEofreportNullreportPseudoAttrProblemreportUnexpectedCharreportXmlProblem

Field Detail

_inback to summary
pack-priv final Reader _in

Underlying Reader to use for reading content.

_inputBufferback to summary
pack-priv final char[] _inputBuffer
_inputLastback to summary
private int _inputLast

Offset of the first character after the end of valid buffer contents.

_inputPtrback to summary
private int _inputPtr
CHAR_BOM_MARKERback to summary
pack-priv static final char CHAR_BOM_MARKER
DEFAULT_BUFFER_SIZEback to summary
pack-priv static final int DEFAULT_BUFFER_SIZE

Whether to use a bigger (4000, ie. 8k) or smaller (2000 -> 4k) buffer size?

Constructor Detail

CharSourceBootstrapperback to summary
private CharSourceBootstrapper(ReaderConfig cfg, Reader r)
CharSourceBootstrapperback to summary
private CharSourceBootstrapper(ReaderConfig cfg, char[] buffer, int start, int len)

Method Detail

bootstrapback to summary
public final XmlScanner bootstrap() throws XMLStreamException

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.bootstrap.

Doc from com.fasterxml.aalto.in.InputBootstrapper.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.

Annotations
@Override
checkKeywordback to summary
protected int checkKeyword(String exp) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.checkKeyword.

Returns:int

First character that does not match expected, if any; CHAR_NULL if match succeeded

Annotations
@Override
constructback to summary
public static CharSourceBootstrapper construct(ReaderConfig cfg, Reader r) throws XMLStreamException
constructback to summary
public static CharSourceBootstrapper construct(ReaderConfig cfg, char[] buffer, int start, int len) throws XMLStreamException
doBootstrapback to summary
public XmlScanner doBootstrap() throws IOException, XMLStreamException
getLocationback to summary
protected Location getLocation()

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.getLocation.

Annotations
@Override
getNextback to summary
protected int getNext() throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.getNext.

Annotations
@Override
getNextAfterWsback to summary
protected int getNextAfterWs(boolean reqWs) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.getNextAfterWs.

Annotations
@Override
initialLoadback to summary
protected boolean initialLoad(int minimum) throws IOException
loadMoreback to summary
protected void loadMore() throws IOException, XMLStreamException
nextCharback to summary
protected char nextChar() throws IOException, XMLStreamException
pushbackback to summary
protected void pushback()

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.pushback.

Annotations
@Override
readQuotedValueback to summary
protected int readQuotedValue(char[] kw, int quoteChar) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.in.InputBootstrapper.readQuotedValue.

Annotations
@Override
skipCRLFback to summary
protected void skipCRLF(char lf) throws IOException, XMLStreamException
verifyXmlEncodingback to summary
protected String verifyXmlEncoding(String enc) throws XMLStreamException
Returns:String

Normalized encoding name