public abstract class JSONLexerBase extends Object implements JSONLexer, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected int |
bp |
protected Calendar |
calendar |
protected char |
ch |
protected static int[] |
digits |
protected int |
eofPos |
protected int |
features |
protected boolean |
hasSpecial |
protected static int |
INT_MULTMIN_RADIX_TEN |
protected static int |
INT_N_MULTMAX_RADIX_TEN |
protected Keywords |
keywods |
int |
matchStat |
protected static long |
MULTMIN_RADIX_TEN |
protected static long |
N_MULTMAX_RADIX_TEN |
protected int |
np
number start position
|
protected int |
pos |
protected char[] |
sbuf
A character buffer for literals.
|
protected int |
sp |
protected int |
token |
protected static char[] |
typeFieldName |
protected static boolean[] |
whitespaceFlags |
| Constructor and Description |
|---|
JSONLexerBase() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
addSymbol(int offset,
int len,
int hash,
SymbolTable symbolTable) |
protected abstract void |
arrayCopy(int srcPos,
char[] dest,
int destPos,
int length) |
abstract byte[] |
bytesValue() |
protected abstract boolean |
charArrayCompare(char[] chars) |
abstract char |
charAt(int index) |
void |
close() |
void |
config(Feature feature,
boolean state) |
protected abstract void |
copyTo(int offset,
int count,
char[] dest) |
BigDecimal |
decimalValue() |
Number |
decimalValue(boolean decimal) |
double |
doubleValue() |
float |
floatValue() |
int |
getBufferPosition() |
Calendar |
getCalendar() |
char |
getCurrent() |
abstract int |
indexOf(char ch,
int startIndex) |
Number |
integerValue() |
int |
intValue() |
boolean |
isBlankInput() |
boolean |
isEnabled(Feature feature) |
abstract boolean |
isEOF() |
boolean |
isRef() |
static boolean |
isWhitespace(char ch) |
protected void |
lexError(String key,
Object... args) |
long |
longValue() |
boolean |
matchField(char[] fieldName) |
int |
matchStat() |
abstract char |
next() |
void |
nextIdent() |
void |
nextToken() |
void |
nextToken(int expect) |
void |
nextTokenWithChar(char expect) |
void |
nextTokenWithChar(char seperator,
int expect) |
void |
nextTokenWithColon() |
void |
nextTokenWithColon(int expect) |
void |
nextTokenWithComma() |
void |
nextTokenWithComma(int expect) |
abstract String |
numberString() |
Number |
numberValue() |
int |
pos() |
protected void |
putChar(char ch) |
void |
resetStringPosition() |
boolean |
scanBoolean(char expectNext) |
Enum<?> |
scanEnum(Class<?> enumClass,
SymbolTable symbolTable,
char serperator) |
void |
scanFalse() |
boolean |
scanFieldBoolean(char[] fieldName) |
double |
scanFieldDouble(char seperator) |
double |
scanFieldDouble(char[] fieldName) |
float |
scanFieldFloat(char[] fieldName) |
int |
scanFieldInt(char[] fieldName) |
long |
scanFieldLong(char[] fieldName) |
String |
scanFieldString(char[] fieldName) |
Collection<String> |
scanFieldStringArray(char[] fieldName,
Class<?> type) |
String |
scanFieldSymbol(char[] fieldName,
SymbolTable symbolTable) |
float |
scanFloat(char seperator) |
void |
scanIdent() |
int |
scanInt(char expectNext) |
long |
scanLong(char expectNextChar) |
void |
scanNullOrNew() |
void |
scanNumber() |
void |
scanSet() |
void |
scanString() |
String |
scanString(char expectNextChar) |
Collection<String> |
scanStringArray(Class<?> type,
char seperator) |
String |
scanSymbol(SymbolTable symbolTable) |
String |
scanSymbol(SymbolTable symbolTable,
char quote) |
String |
scanSymbolUnQuoted(SymbolTable symbolTable) |
String |
scanSymbolWithSeperator(SymbolTable symbolTable,
char serperator) |
void |
scanTreeSet() |
void |
scanTrue() |
int |
scanType(String type) |
void |
skipWhitespace() |
String |
stringDefaultValue() |
abstract String |
stringVal() |
abstract String |
subString(int offset,
int count) |
int |
token() |
String |
tokenName() |
protected int token
protected int pos
protected int features
protected char ch
protected int bp
protected int eofPos
protected char[] sbuf
protected int sp
protected int np
protected boolean hasSpecial
protected Calendar calendar
public int matchStat
protected Keywords keywods
protected static final char[] typeFieldName
protected static boolean[] whitespaceFlags
protected static final long MULTMIN_RADIX_TEN
protected static final long N_MULTMAX_RADIX_TEN
protected static final int INT_MULTMIN_RADIX_TEN
protected static final int INT_N_MULTMAX_RADIX_TEN
protected static final int[] digits
public final int matchStat()
public final void nextIdent()
public final void nextTokenWithColon()
nextTokenWithColon in interface JSONLexerpublic final void nextTokenWithComma()
public final void nextTokenWithChar(char expect)
public final int getBufferPosition()
getBufferPosition in interface JSONLexerpublic final String stringDefaultValue()
public final Number integerValue() throws NumberFormatException
integerValue in interface JSONLexerNumberFormatExceptionpublic final void nextTokenWithColon(int expect)
nextTokenWithColon in interface JSONLexerpublic final void nextTokenWithComma(int expect)
public final void nextTokenWithChar(char seperator,
int expect)
public float floatValue()
floatValue in interface JSONLexerpublic double doubleValue()
public void config(Feature feature, boolean state)
public final boolean isEnabled(Feature feature)
public abstract String numberString()
numberString in interface JSONLexerpublic abstract boolean isEOF()
public final char getCurrent()
getCurrent in interface JSONLexerpublic abstract char charAt(int index)
public final String scanSymbol(SymbolTable symbolTable)
scanSymbol in interface JSONLexerprotected abstract void arrayCopy(int srcPos,
char[] dest,
int destPos,
int length)
public final String scanSymbol(SymbolTable symbolTable, char quote)
scanSymbol in interface JSONLexerpublic final void resetStringPosition()
resetStringPosition in interface JSONLexerpublic final String scanSymbolUnQuoted(SymbolTable symbolTable)
scanSymbolUnQuoted in interface JSONLexerprotected abstract void copyTo(int offset,
int count,
char[] dest)
public final void scanString()
scanString in interface JSONLexerpublic Calendar getCalendar()
public abstract byte[] bytesValue()
bytesValue in interface JSONLexerpublic void close()
public int scanType(String type)
public final boolean matchField(char[] fieldName)
public abstract int indexOf(char ch,
int startIndex)
public abstract String addSymbol(int offset, int len, int hash, SymbolTable symbolTable)
public String scanFieldString(char[] fieldName)
public String scanString(char expectNextChar)
scanString in interface JSONLexerpublic String scanFieldSymbol(char[] fieldName, SymbolTable symbolTable)
public Enum<?> scanEnum(Class<?> enumClass, SymbolTable symbolTable, char serperator)
public String scanSymbolWithSeperator(SymbolTable symbolTable, char serperator)
scanSymbolWithSeperator in interface JSONLexerpublic Collection<String> scanFieldStringArray(char[] fieldName, Class<?> type)
public Collection<String> scanStringArray(Class<?> type, char seperator)
scanStringArray in interface JSONLexerpublic int scanFieldInt(char[] fieldName)
public boolean scanBoolean(char expectNext)
public boolean scanFieldBoolean(char[] fieldName)
public long scanFieldLong(char[] fieldName)
public final float scanFieldFloat(char[] fieldName)
public final float scanFloat(char seperator)
public final double scanFieldDouble(char[] fieldName)
public final double scanFieldDouble(char seperator)
public final void scanTrue()
public final void scanTreeSet()
public final void scanNullOrNew()
public final void scanFalse()
public final void scanIdent()
public abstract String subString(int offset, int count)
protected abstract boolean charArrayCompare(char[] chars)
public final boolean isBlankInput()
isBlankInput in interface JSONLexerpublic final void skipWhitespace()
skipWhitespace in interface JSONLexerpublic final void scanSet()
protected final void putChar(char ch)
public final void scanNumber()
scanNumber in interface JSONLexerpublic final long longValue()
throws NumberFormatException
longValue in interface JSONLexerNumberFormatExceptionpublic final Number decimalValue(boolean decimal)
decimalValue in interface JSONLexerpublic final BigDecimal decimalValue()
decimalValue in interface JSONLexerpublic final Number numberValue()
numberValue in interface JSONLexerpublic static final boolean isWhitespace(char ch)
Copyright © 2016 jufeng. All rights reserved.