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[]
int
Position in buffer.protected int
protected int
protected Reader
protected int
protected int
protected char[]
protected int
protected boolean
protected boolean
static final boolean
Whether 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 TypeMethodDescriptionvoid
adjustBeginLineColumn
(int newLine, int newCol) Method to adjust line and column numbers for the start of a token.protected void
void
backup
(int amount) Retreat.char
void
Done()
Set buffers back to null when finished.protected void
ExpandBuff
(boolean wrapAround) protected void
FillBuff()
int
int
int
Deprecated.int
Get end column.int
Get end line.GetImage()
int
getLine()
Deprecated.char[]
GetSuffix
(int len) protected int
getTabSize
(int i) protected char
ReadByte()
char
readChar()
Read a character.void
ReInit
(InputStream dstream) Reinitialise.void
ReInit
(InputStream dstream, int startline, int startcolumn) Reinitialise.void
ReInit
(InputStream dstream, int startline, int startcolumn, int buffersize) Reinitialise.void
ReInit
(InputStream dstream, String encoding) Reinitialise.void
ReInit
(InputStream dstream, String encoding, int startline, int startcolumn) Reinitialise.void
ReInit
(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) Reinitialise.void
Reinitialise.void
Reinitialise.void
Reinitialise.protected void
setTabSize
(int i) protected void
UpdateLineColumn
(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.
-