Package org.apache.tomcat.util.json
Class JavaCharStream
java.lang.Object
org.apache.tomcat.util.json.JavaCharStream
An implementation of interface CharStream, where the stream is assumed to
 contain only ASCII characters (with java-like unicode escape processing).
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected int[]protected char[]protected int[]intPosition in buffer.protected intprotected intprotected Readerprotected intprotected intprotected char[]protected intprotected booleanprotected booleanstatic final booleanWhether parser is static.protected intprotected boolean
- 
Constructor SummaryConstructorsConstructorDescriptionJavaCharStream(InputStream dstream) Constructor.JavaCharStream(InputStream dstream, int startline, int startcolumn) Constructor.JavaCharStream(InputStream dstream, int startline, int startcolumn, int buffersize) Constructor.JavaCharStream(InputStream dstream, String encoding) Constructor.JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn) Constructor.JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) Constructor.JavaCharStream(Reader dstream) Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn) Constructor.JavaCharStream(Reader dstream, int startline, int startcolumn, int buffersize) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadjustBeginLineColumn(int newLine, int newCol) Method to adjust line and column numbers for the start of a token.protected voidvoidbackup(int amount) Retreat.charvoidDone()Set buffers back to null when finished.protected voidExpandBuff(boolean wrapAround) protected voidFillBuff()intintintDeprecated.intGet end column.intGet end line.GetImage()intgetLine()Deprecated.char[]GetSuffix(int len) intprotected charReadByte()charreadChar()Read a character.voidReInit(InputStream dstream) Reinitialise.voidReInit(InputStream dstream, int startline, int startcolumn) Reinitialise.voidReInit(InputStream dstream, int startline, int startcolumn, int buffersize) Reinitialise.voidReInit(InputStream dstream, String encoding) Reinitialise.voidReInit(InputStream dstream, String encoding, int startline, int startcolumn) Reinitialise.voidReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) Reinitialise.voidReinitialise.voidReinitialise.voidReinitialise.voidsetTabSize(int i) protected voidUpdateLineColumn(char c) 
- 
Field Details- 
staticFlagpublic static final boolean staticFlagWhether parser is static.- See Also:
 
- 
bufpospublic int bufposPosition in buffer.
- 
buflineprotected int[] bufline
- 
bufcolumnprotected int[] bufcolumn
- 
columnprotected int column
- 
lineprotected int line
- 
prevCharIsCRprotected boolean prevCharIsCR
- 
prevCharIsLFprotected boolean prevCharIsLF
- 
inputStream
- 
nextCharBufprotected char[] nextCharBuf
- 
bufferprotected char[] buffer
- 
maxNextCharIndprotected int maxNextCharInd
- 
nextCharIndprotected int nextCharInd
- 
inBufprotected int inBuf
- 
tabSizeprotected int tabSize
- 
trackLineColumnprotected boolean trackLineColumn
 
- 
- 
Constructor Details- 
JavaCharStreamConstructor.
- 
JavaCharStreamConstructor.
- 
JavaCharStreamConstructor.
- 
JavaCharStreampublic JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Constructor.- Throws:
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.
- 
JavaCharStreampublic JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Constructor.- Throws:
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.
- 
JavaCharStreamConstructor.- Throws:
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.
 
- 
- 
Method Details- 
setTabSizepublic void setTabSize(int i) 
- 
getTabSizepublic int getTabSize()
- 
ExpandBuffprotected void ExpandBuff(boolean wrapAround) 
- 
FillBuff- Throws:
- IOException
 
- 
ReadByte- Throws:
- IOException
 
- 
BeginToken- Returns:
- starting character for token.
- Throws:
- IOException
 
- 
AdjustBuffSizeprotected void AdjustBuffSize()
- 
UpdateLineColumnprotected void UpdateLineColumn(char c) 
- 
readCharRead a character.- Throws:
- IOException
 
- 
getColumnDeprecated.
- 
getLineDeprecated.
- 
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.
- 
ReInitReinitialise.
- 
ReInitReinitialise.
- 
ReInitReinitialise.
- 
ReInitpublic void ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Reinitialise.- Throws:
- UnsupportedEncodingException
 
- 
ReInitReinitialise.
- 
ReInitpublic void ReInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Reinitialise.- Throws:
- UnsupportedEncodingException
 
- 
ReInitReinitialise.
- 
ReInitReinitialise.- Throws:
- UnsupportedEncodingException
 
- 
ReInitReinitialise.
- 
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.
 
-