Package org.apache.cayenne.exp.parser
Class JavaCharStream
java.lang.Object
org.apache.cayenne.exp.parser.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[]intprotected 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()intGet the beginning column.intintDeprecated.intGet end column.intGet end line.GetImage()Get the token timage.intgetLine()Deprecated.char[]GetSuffix(int len) Get the suffix as an array of characters.intprotected charReadByte()charreadChar()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.voidvoidvoidvoidsetTabSize(int i) protected voidUpdateLineColumn(char c) 
- 
Field Details- 
staticFlagpublic static final boolean staticFlagWhether parser is static.- See Also:
 
- 
bufpospublic int bufpos
- 
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.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- buffersize- size of the buffer
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
 
- 
JavaCharStreampublic JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Constructor.- Throws:
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- buffersize- size of the buffer
 
- 
JavaCharStreampublic JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Constructor.- Parameters:
- dstream- the underlying data source.
- encoding- the character encoding of the data stream.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- Throws:
- UnsupportedEncodingException- encoding is invalid or unsupported.
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
- encoding- the character encoding of the data stream.
- Throws:
- UnsupportedEncodingException- encoding is invalid or unsupported.
- UnsupportedEncodingException
 
- 
JavaCharStreamConstructor.- Parameters:
- dstream- the underlying data source.
 
 
- 
- 
Method Details- 
setTabSizepublic void setTabSize(int i) 
- 
getTabSizepublic int getTabSize()
- 
ExpandBuffprotected void ExpandBuff(boolean wrapAround) 
- 
FillBuff- Throws:
- IOException
 
- 
ReadByte- Throws:
- IOException
 
- 
BeginToken- Throws:
- IOException
 
- 
AdjustBuffSizeprotected void AdjustBuffSize()
- 
UpdateLineColumnprotected void UpdateLineColumn(char c) 
- 
readChar- Throws:
- IOException
 
- 
getColumnDeprecated.
- 
getLineDeprecated.
- 
getEndColumnpublic int getEndColumn()Get end column.- Returns:
- the end column or -1
 
- 
getEndLinepublic int getEndLine()Get end line.- Returns:
- the end line number or -1
 
- 
getBeginColumnpublic int getBeginColumn()Get the beginning column.- Returns:
- column of token start
 
- 
getBeginLinepublic int getBeginLine()- Returns:
- line number of token start
 
- 
backuppublic void backup(int amount) Retreat.
- 
ReInit
- 
ReInit
- 
ReInit
- 
ReInitpublic void ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Reinitialise.- Parameters:
- dstream- the underlying data source.
- encoding- the character encoding of the data stream.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- buffersize- size of the buffer
- Throws:
- UnsupportedEncodingException
 
- 
ReInitReinitialise.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- buffersize- size of the buffer
 
- 
ReInitpublic void ReInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Reinitialise.- Parameters:
- dstream- the underlying data source.
- encoding- the character encoding of the data stream.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
- Throws:
- UnsupportedEncodingException- encoding is invalid or unsupported.
- UnsupportedEncodingException
 
- 
ReInitReinitialise.- Parameters:
- dstream- the underlying data source.
- startline- line number of the first character of the stream, mostly for error messages.
- startcolumn- column number of the first character of the stream.
 
- 
ReInitReinitialise.- Parameters:
- dstream- the underlying data source.
- encoding- the character encoding of the data stream.
- Throws:
- UnsupportedEncodingException- encoding is invalid or unsupported.
- UnsupportedEncodingException
 
- 
ReInitReinitialise.- Parameters:
- dstream- the underlying data source.
 
- 
GetImageGet the token timage.- Returns:
- token image as String
 
- 
GetSuffixpublic char[] GetSuffix(int len) Get the suffix as an array of characters.- Parameters:
- len- the length of the array to return.
- 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.- Parameters:
- newLine- the new line number.
- newCol- the new column number.
 
 
-