com.fasterxml.aalto.in
Class ByteSourceBootstrapper

java.lang.Object
  extended by com.fasterxml.aalto.in.InputBootstrapper
      extended by com.fasterxml.aalto.in.ByteSourceBootstrapper
All Implemented Interfaces:
XmlConsts

public final class ByteSourceBootstrapper
extends InputBootstrapper

Class that takes care of bootstrapping main document input from a byte-oriented input source: usually either an InputStream, or a block source like byte array.


Field Summary
 
Fields inherited from class com.fasterxml.aalto.in.InputBootstrapper
_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
 
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
 
Method Summary
protected  int checkKeyword(String exp)
           
protected  int checkMbKeyword(String expected)
           
protected  int checkSbKeyword(String expected)
           
static ByteSourceBootstrapper construct(ReaderConfig cfg, byte[] inputBuffer, int inputStart, int inputLen)
           
static ByteSourceBootstrapper construct(ReaderConfig cfg, InputStream in)
           
 XmlScanner doBootstrap()
           
protected  boolean ensureLoaded(int minimum)
           
protected  Location getLocation()
           
protected  int getNext()
           
protected  int getNextAfterWs(boolean reqWs)
           
protected  boolean hasXmlDeclaration()
           
protected  void loadMore()
           
protected  byte nextByte()
           
protected  int nextMultiByte()
           
protected  void pushback()
           
protected  int readQuotedValue(char[] kw, int quoteChar)
           
protected  void skipMbLF(int lf)
           
protected  int skipMbWs()
           
protected  void skipSbLF(byte lfByte)
           
protected  int skipSbWs()
           
protected  String verifyXmlEncoding(String enc)
           
 
Methods inherited from class com.fasterxml.aalto.in.InputBootstrapper
bootstrap, readXmlDeclaration, reportEof, reportNull, reportPseudoAttrProblem, reportUnexpectedChar, reportXmlProblem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

construct

public static ByteSourceBootstrapper construct(ReaderConfig cfg,
                                               InputStream in)
                                        throws XMLStreamException
Throws:
XMLStreamException

construct

public static ByteSourceBootstrapper construct(ReaderConfig cfg,
                                               byte[] inputBuffer,
                                               int inputStart,
                                               int inputLen)
                                        throws XMLStreamException
Throws:
XMLStreamException

doBootstrap

public XmlScanner doBootstrap()
                       throws IOException,
                              XMLStreamException
Specified by:
doBootstrap in class InputBootstrapper
Throws:
IOException
XMLStreamException

hasXmlDeclaration

protected boolean hasXmlDeclaration()
                             throws IOException,
                                    XMLStreamException
Throws:
IOException
XMLStreamException

verifyXmlEncoding

protected String verifyXmlEncoding(String enc)
                            throws XMLStreamException
Returns:
Normalized encoding name
Throws:
XMLStreamException

ensureLoaded

protected boolean ensureLoaded(int minimum)
                        throws IOException
Throws:
IOException

loadMore

protected void loadMore()
                 throws IOException,
                        XMLStreamException
Throws:
IOException
XMLStreamException

pushback

protected void pushback()
Specified by:
pushback in class InputBootstrapper

getNext

protected int getNext()
               throws IOException,
                      XMLStreamException
Specified by:
getNext in class InputBootstrapper
Throws:
IOException
XMLStreamException

getNextAfterWs

protected int getNextAfterWs(boolean reqWs)
                      throws IOException,
                             XMLStreamException
Specified by:
getNextAfterWs in class InputBootstrapper
Throws:
IOException
XMLStreamException

checkKeyword

protected int checkKeyword(String exp)
                    throws IOException,
                           XMLStreamException
Specified by:
checkKeyword in class InputBootstrapper
Returns:
First character that does not match expected, if any; CHAR_NULL if match succeeded
Throws:
IOException
XMLStreamException

readQuotedValue

protected int readQuotedValue(char[] kw,
                              int quoteChar)
                       throws IOException,
                              XMLStreamException
Specified by:
readQuotedValue in class InputBootstrapper
Throws:
IOException
XMLStreamException

getLocation

protected Location getLocation()
Specified by:
getLocation in class InputBootstrapper

nextByte

protected byte nextByte()
                 throws IOException,
                        XMLStreamException
Throws:
IOException
XMLStreamException

skipSbWs

protected int skipSbWs()
                throws IOException,
                       XMLStreamException
Throws:
IOException
XMLStreamException

skipSbLF

protected void skipSbLF(byte lfByte)
                 throws IOException,
                        XMLStreamException
Throws:
IOException
XMLStreamException

checkSbKeyword

protected int checkSbKeyword(String expected)
                      throws IOException,
                             XMLStreamException
Returns:
First character that does not match expected, if any; CHAR_NULL if match succeeded
Throws:
IOException
XMLStreamException

nextMultiByte

protected int nextMultiByte()
                     throws IOException,
                            XMLStreamException
Throws:
IOException
XMLStreamException

skipMbWs

protected int skipMbWs()
                throws IOException,
                       XMLStreamException
Throws:
IOException
XMLStreamException

skipMbLF

protected void skipMbLF(int lf)
                 throws IOException,
                        XMLStreamException
Throws:
IOException
XMLStreamException

checkMbKeyword

protected int checkMbKeyword(String expected)
                      throws IOException,
                             XMLStreamException
Returns:
First character that does not match expected, if any; CHAR_NULL if match succeeded
Throws:
IOException
XMLStreamException


Copyright © 2012 Fasterxml.com. All Rights Reserved.