Package org.apache.tomcat.util.json
Class JavaCharStream
- java.lang.Object
- 
- org.apache.tomcat.util.json.JavaCharStream
 
- 
 public class JavaCharStream extends java.lang.ObjectAn implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (with java-like unicode escape processing).
- 
- 
Field SummaryFields Modifier and Type Field Description protected int[]bufcolumnprotected char[]bufferprotected int[]buflineintbufposPosition in buffer.protected intcolumnprotected intinBufprotected java.io.ReaderinputStreamprotected intlineprotected intmaxNextCharIndprotected char[]nextCharBufprotected intnextCharIndprotected booleanprevCharIsCRprotected booleanprevCharIsLFstatic booleanstaticFlagWhether parser is static.protected inttabSizeprotected booleantrackLineColumn
 - 
Constructor SummaryConstructors Constructor Description JavaCharStream(java.io.InputStream dstream)Constructor.JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn)Constructor.JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)Constructor.JavaCharStream(java.io.InputStream dstream, java.lang.String encoding)Constructor.JavaCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn)Constructor.JavaCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize)Constructor.JavaCharStream(java.io.Reader dstream)Constructor.JavaCharStream(java.io.Reader dstream, int startline, int startcolumn)Constructor.JavaCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadjustBeginLineColumn(int newLine, int newCol)Method to adjust line and column numbers for the start of a token.protected voidAdjustBuffSize()voidbackup(int amount)Retreat.charBeginToken()voidDone()Set buffers back to null when finished.protected voidExpandBuff(boolean wrapAround)protected voidFillBuff()intgetBeginColumn()intgetBeginLine()intgetColumn()Deprecated.intgetEndColumn()Get end column.intgetEndLine()Get end line.java.lang.StringGetImage()intgetLine()Deprecated.char[]GetSuffix(int len)intgetTabSize()protected charReadByte()charreadChar()Read a character.voidReInit(java.io.InputStream dstream)Reinitialise.voidReInit(java.io.InputStream dstream, int startline, int startcolumn)Reinitialise.voidReInit(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)Reinitialise.voidReInit(java.io.InputStream dstream, java.lang.String encoding)Reinitialise.voidReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn)Reinitialise.voidReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize)Reinitialise.voidReInit(java.io.Reader dstream)Reinitialise.voidReInit(java.io.Reader dstream, int startline, int startcolumn)Reinitialise.voidReInit(java.io.Reader dstream, int startline, int startcolumn, int buffersize)Reinitialise.voidsetTabSize(int i)protected voidUpdateLineColumn(char c)
 
- 
- 
- 
Field Detail- 
staticFlagpublic static final boolean staticFlag Whether parser is static.- See Also:
- Constant Field Values
 
 - 
bufpospublic int bufpos Position in buffer.
 - 
buflineprotected int[] bufline 
 - 
bufcolumnprotected int[] bufcolumn 
 - 
columnprotected int column 
 - 
lineprotected int line 
 - 
prevCharIsCRprotected boolean prevCharIsCR 
 - 
prevCharIsLFprotected boolean prevCharIsLF 
 - 
inputStreamprotected java.io.Reader inputStream 
 - 
nextCharBufprotected char[] nextCharBuf 
 - 
bufferprotected char[] buffer 
 - 
maxNextCharIndprotected int maxNextCharInd 
 - 
nextCharIndprotected int nextCharInd 
 - 
inBufprotected int inBuf 
 - 
tabSizeprotected int tabSize 
 - 
trackLineColumnprotected boolean trackLineColumn 
 
- 
 - 
Constructor Detail- 
JavaCharStreampublic JavaCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize)Constructor.
 - 
JavaCharStreampublic JavaCharStream(java.io.Reader dstream, int startline, int startcolumn)Constructor.
 - 
JavaCharStreampublic JavaCharStream(java.io.Reader dstream) Constructor.
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize) throws java.io.UnsupportedEncodingExceptionConstructor.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)Constructor.
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn) throws java.io.UnsupportedEncodingExceptionConstructor.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn)Constructor.
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream, java.lang.String encoding) throws java.io.UnsupportedEncodingExceptionConstructor.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
JavaCharStreampublic JavaCharStream(java.io.InputStream dstream) Constructor.
 
- 
 - 
Method Detail- 
setTabSizepublic void setTabSize(int i) 
 - 
getTabSizepublic int getTabSize() 
 - 
ExpandBuffprotected void ExpandBuff(boolean wrapAround) 
 - 
FillBuffprotected void FillBuff() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
ReadByteprotected char ReadByte() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
BeginTokenpublic char BeginToken() throws java.io.IOException- Returns:
- starting character for token.
- Throws:
- java.io.IOException
 
 - 
AdjustBuffSizeprotected void AdjustBuffSize() 
 - 
UpdateLineColumnprotected void UpdateLineColumn(char c) 
 - 
readCharpublic char readChar() throws java.io.IOExceptionRead a character.- Throws:
- java.io.IOException
 
 - 
getColumn@Deprecated public int getColumn() Deprecated.
 - 
getLine@Deprecated public int getLine() Deprecated.
 - 
getEndColumnpublic int getEndColumn() Get end column.
 - 
getEndLinepublic int getEndLine() Get end line.
 - 
getBeginColumnpublic int getBeginColumn() - Returns:
- column of token start
 
 - 
getBeginLinepublic int getBeginLine() - Returns:
- line number of token start
 
 - 
backuppublic void backup(int amount) Retreat.
 - 
ReInitpublic void ReInit(java.io.Reader dstream, int startline, int startcolumn, int buffersize)Reinitialise.
 - 
ReInitpublic void ReInit(java.io.Reader dstream, int startline, int startcolumn)Reinitialise.
 - 
ReInitpublic void ReInit(java.io.Reader dstream) Reinitialise.
 - 
ReInitpublic void ReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn, int buffersize) throws java.io.UnsupportedEncodingExceptionReinitialise.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
ReInitpublic void ReInit(java.io.InputStream dstream, int startline, int startcolumn, int buffersize)Reinitialise.
 - 
ReInitpublic void ReInit(java.io.InputStream dstream, java.lang.String encoding, int startline, int startcolumn) throws java.io.UnsupportedEncodingExceptionReinitialise.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
ReInitpublic void ReInit(java.io.InputStream dstream, int startline, int startcolumn)Reinitialise.
 - 
ReInitpublic void ReInit(java.io.InputStream dstream, java.lang.String encoding) throws java.io.UnsupportedEncodingExceptionReinitialise.- Throws:
- java.io.UnsupportedEncodingException
 
 - 
ReInitpublic void ReInit(java.io.InputStream dstream) Reinitialise.
 - 
GetImagepublic java.lang.String GetImage() - Returns:
- token image as String
 
 - 
GetSuffixpublic char[] GetSuffix(int len) - Returns:
- suffix
 
 - 
Donepublic void Done() Set buffers back to null when finished.
 - 
adjustBeginLineColumnpublic void adjustBeginLineColumn(int newLine, int newCol)Method to adjust line and column numbers for the start of a token.
 
- 
 
-