Class JavaCharStream
java.lang.Object
com.randomnoun.common.jexl.parser.JavaCharStream
An implementation of interface CharStream, where the stream is assumed to
contain only ASCII characters (with java-like unicode escape processing).
-
Field Summary
FieldsModifier 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 int -
Constructor Summary
ConstructorsConstructorDescriptionJavaCharStream(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 Summary
Modifier 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) protected intgetTabSize(int i) protected 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.protected voidsetTabSize(int i) protected voidUpdateLineColumn(char c)
-
Field Details
-
staticFlag
Whether parser is static.- See Also:
-
bufpos
Position in buffer. -
bufline
-
bufcolumn
-
column
-
line
-
prevCharIsCR
-
prevCharIsLF
-
inputStream
-
nextCharBuf
-
buffer
-
maxNextCharInd
-
nextCharInd
-
inBuf
-
tabSize
-
-
Constructor Details
-
JavaCharStream
Constructor. -
JavaCharStream
Constructor. -
JavaCharStream
Constructor. -
JavaCharStream
public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
Constructor. -
JavaCharStream
public JavaCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
Constructor. -
JavaCharStream
Constructor.- Throws:
UnsupportedEncodingException
-
JavaCharStream
Constructor.
-
-
Method Details
-
setTabSize
-
getTabSize
-
ExpandBuff
-
FillBuff
- Throws:
IOException
-
ReadByte
- Throws:
IOException
-
BeginToken
- Returns:
- starting character for token.
- Throws:
IOException
-
AdjustBuffSize
-
UpdateLineColumn
-
readChar
Read a character.- Throws:
IOException
-
getColumn
Deprecated.- See Also:
-
getLine
Deprecated.- See Also:
-
getEndColumn
Get end column. -
getEndLine
Get end line. -
getBeginColumn
- Returns:
- column of token start
-
getBeginLine
- Returns:
- line number of token start
-
backup
Retreat. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
Reinitialise. -
ReInit
public void ReInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
Reinitialise. -
ReInit
Reinitialise.- Throws:
UnsupportedEncodingException
-
ReInit
Reinitialise. -
GetImage
- Returns:
- token image as String
-
GetSuffix
- Returns:
- suffix
-
Done
Set buffers back to null when finished. -
adjustBeginLineColumn
Method to adjust line and column numbers for the start of a token.
-