public class Tokenizer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TT_BLOCK
The Constant TT_BLOCK.
|
static int |
TT_ERROR
The Constant TT_ERROR.
|
static int |
TT_SYMBOL
The Constant TT_SYMBOL.
|
static int |
TT_TOKEN
The Constant TT_TOKEN.
|
| Constructor and Description |
|---|
Tokenizer()
Instantiates a new tokenizer.
|
Tokenizer(Reader reader)
Instantiates a new tokenizer.
|
Tokenizer(Reader reader,
int cacheBufferSize)
Instantiates a new tokenizer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSymbol(String text)
Adds the symbol.
|
void |
addSymbol(String text,
boolean hidden)
Adds the symbol.
|
void |
addSymbol(String startText,
String endText,
boolean hidden)
Adds the symbol.
|
void |
addSymbol(TokenizerSymbol symbol)
Adds the symbol.
|
boolean |
getNextBoolean(String trueValue,
boolean defaultValue)
Gets the next boolean.
|
long |
getNextLong(long defaultValue)
Gets the next long.
|
String |
getNextString(String defaultValue)
Gets the next string.
|
Token |
getToken()
Gets the token.
|
boolean |
hasMore()
Checks for more.
|
Token |
nextToken()
Next token.
|
void |
pushBack()
Push back.
|
void |
setReader(Reader reader)
Sets the reader.
|
public static final int TT_TOKEN
public static final int TT_SYMBOL
public static final int TT_BLOCK
public static final int TT_ERROR
public Tokenizer()
public Tokenizer(Reader reader)
reader - the readerpublic Tokenizer(Reader reader, int cacheBufferSize)
reader - the readercacheBufferSize - the cache buffer sizepublic Token getToken() throws IOException
IOException - Signals that an I/O exception has occurred.public Token nextToken() throws IOException
IOException - Signals that an I/O exception has occurred.public void pushBack()
public void setReader(Reader reader)
reader - the new readerpublic boolean hasMore()
throws IOException
IOException - Signals that an I/O exception has occurred.public void addSymbol(String text)
text - the textpublic void addSymbol(String text, boolean hidden)
text - the texthidden - the hiddenpublic void addSymbol(String startText, String endText, boolean hidden)
startText - the start textendText - the end texthidden - the hiddenpublic void addSymbol(TokenizerSymbol symbol)
symbol - the symbolpublic String getNextString(String defaultValue) throws IOException
defaultValue - the default valueIOException - Signals that an I/O exception has occurred.public boolean getNextBoolean(String trueValue, boolean defaultValue) throws IOException
trueValue - the true valuedefaultValue - the default valueIOException - Signals that an I/O exception has occurred.public long getNextLong(long defaultValue)
throws IOException
defaultValue - the default valueIOException - Signals that an I/O exception has occurred.Copyright © 2009–2020 psi-probe. All rights reserved.