com.ctc.wstx.io
Class WstxInputData

java.lang.Object
  extended bycom.ctc.wstx.io.WstxInputData
Direct Known Subclasses:
StreamScanner

public class WstxInputData
extends java.lang.Object

Base class used by readers (specifically, by StreamScanner, and its sub-classes) to encapsulate input buffer portion of the class. Philosophically this should probably be done via containment (composition), not sub-classing but for performance reason, this "core" class is generally extended from instead.

Main reason for the input data portion to be factored out of main class is that this way it can also be passed to nested input handling Objects, which can then manipulate input buffers of the caller, efficiently.


Field Summary
static char CHAR_NULL
          Null-character is used as return value from some method(s), since it is not a legal character in an XML document.
static char CHAR_SPACE
           
static char INT_NULL
           
static char INT_SPACE
           
static int MAX_UNICODE_CHAR
          This constant defines the highest Unicode character allowed in XML content.
protected  long mCurrInputProcessed
          Current number of characters that were processed in previous blocks, before contents of current input buffer.
protected  int mCurrInputRow
          Current row location of current point in input buffer, starting from 1
protected  int mCurrInputRowStart
          Current index of the first character of the current row in input buffer.
protected  char[] mInputBuffer
          Current buffer from which data is read; generally data is read into buffer from input source, but not always (especially when using nested input contexts when expanding parsed entity references etc).
protected  int mInputLen
          Index of character after last available one in the buffer.
protected  int mInputPtr
          Pointer to next available character in buffer
 
Constructor Summary
protected WstxInputData()
           
 
Method Summary
 void copyBufferStateFrom(WstxInputData src)
          Note: Only public due to sub-classes needing to call this on base class instance from different package (confusing?)
static java.lang.String getCharDesc(char c)
           
static boolean is11NameChar(char c)
          Method that can be used to check whether specified character is a valid character of an XML 1.1 name as any other char than the first one; except that colon (:) is not recognized as valid here: caller has to verify it separately (since it generally affects namespace mapping of a qualified name).
static boolean is11NameStartChar(char c)
          Method that can be used to check whether specified character is a valid first character of an XML 1.1 name; except that colon (:) is not recognized as a start char here: caller has to verify it separately (since it generally affects namespace mapping of a qualified name).
static boolean isSpaceChar(char c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR_NULL

public static final char CHAR_NULL
Null-character is used as return value from some method(s), since it is not a legal character in an XML document.

See Also:
Constant Field Values

INT_NULL

public static final char INT_NULL
See Also:
Constant Field Values

CHAR_SPACE

public static final char CHAR_SPACE
See Also:
Constant Field Values

INT_SPACE

public static final char INT_SPACE
See Also:
Constant Field Values

MAX_UNICODE_CHAR

public static final int MAX_UNICODE_CHAR
This constant defines the highest Unicode character allowed in XML content.

See Also:
Constant Field Values

mInputBuffer

protected char[] mInputBuffer
Current buffer from which data is read; generally data is read into buffer from input source, but not always (especially when using nested input contexts when expanding parsed entity references etc).


mInputPtr

protected int mInputPtr
Pointer to next available character in buffer


mInputLen

protected int mInputLen
Index of character after last available one in the buffer.


mCurrInputProcessed

protected long mCurrInputProcessed
Current number of characters that were processed in previous blocks, before contents of current input buffer.


mCurrInputRow

protected int mCurrInputRow
Current row location of current point in input buffer, starting from 1


mCurrInputRowStart

protected int mCurrInputRowStart
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.

Constructor Detail

WstxInputData

protected WstxInputData()
Method Detail

copyBufferStateFrom

public void copyBufferStateFrom(WstxInputData src)
Note: Only public due to sub-classes needing to call this on base class instance from different package (confusing?)


is11NameStartChar

public static final boolean is11NameStartChar(char c)
Method that can be used to check whether specified character is a valid first character of an XML 1.1 name; except that colon (:) is not recognized as a start char here: caller has to verify it separately (since it generally affects namespace mapping of a qualified name).


is11NameChar

public static final boolean is11NameChar(char c)
Method that can be used to check whether specified character is a valid character of an XML 1.1 name as any other char than the first one; except that colon (:) is not recognized as valid here: caller has to verify it separately (since it generally affects namespace mapping of a qualified name).


isSpaceChar

public static final boolean isSpaceChar(char c)

getCharDesc

public static java.lang.String getCharDesc(char c)