com.alibaba.fastjson.parser
Class JSONScanner
java.lang.Object
com.alibaba.fastjson.parser.JSONScanner
- All Implemented Interfaces:
- JSONLexer
public final class JSONScanner
- extends Object
- implements JSONLexer
- Author:
- wenshao
EOI
public static final byte EOI
- See Also:
- Constant Field Values
resetCount
public int resetCount
NOT_MATCH
public static final int NOT_MATCH
- See Also:
- Constant Field Values
NOT_MATCH_NAME
public static final int NOT_MATCH_NAME
- See Also:
- Constant Field Values
UNKOWN
public static final int UNKOWN
- See Also:
- Constant Field Values
OBJECT
public static final int OBJECT
- See Also:
- Constant Field Values
ARRAY
public static final int ARRAY
- See Also:
- Constant Field Values
VALUE
public static final int VALUE
- See Also:
- Constant Field Values
END
public static final int END
- See Also:
- Constant Field Values
matchStat
public int matchStat
ISO8601_LEN_0
public final int ISO8601_LEN_0
ISO8601_LEN_1
public final int ISO8601_LEN_1
ISO8601_LEN_2
public final int ISO8601_LEN_2
JSONScanner
public JSONScanner(String input)
JSONScanner
public JSONScanner(String input,
int features)
JSONScanner
public JSONScanner(char[] input,
int inputLength)
JSONScanner
public JSONScanner(char[] input,
int inputLength,
int features)
isResetFlag
public boolean isResetFlag()
- Specified by:
isResetFlag
in interface JSONLexer
setResetFlag
public void setResetFlag(boolean resetFlag)
- Specified by:
setResetFlag
in interface JSONLexer
getBufferPosition
public final int getBufferPosition()
- Specified by:
getBufferPosition
in interface JSONLexer
reset
public void reset(int mark,
char mark_ch,
int token)
isBlankInput
public boolean isBlankInput()
- Specified by:
isBlankInput
in interface JSONLexer
isWhitespace
public static final boolean isWhitespace(char ch)
token
public final int token()
- Return the current token, set by nextToken().
- Specified by:
token
in interface JSONLexer
tokenName
public final String tokenName()
- Specified by:
tokenName
in interface JSONLexer
skipWhitespace
public final void skipWhitespace()
- Specified by:
skipWhitespace
in interface JSONLexer
getCurrent
public final char getCurrent()
- Specified by:
getCurrent
in interface JSONLexer
nextTokenWithColon
public final void nextTokenWithColon()
nextTokenWithColon
public final void nextTokenWithColon(int expect)
- Specified by:
nextTokenWithColon
in interface JSONLexer
incrementBufferPosition
public final void incrementBufferPosition()
- Specified by:
incrementBufferPosition
in interface JSONLexer
resetStringPosition
public final void resetStringPosition()
- Specified by:
resetStringPosition
in interface JSONLexer
nextToken
public void nextToken(int expect)
- Specified by:
nextToken
in interface JSONLexer
nextToken
public final void nextToken()
- Specified by:
nextToken
in interface JSONLexer
scanStringSingleQuote
public final void scanStringSingleQuote()
scanString
public final void scanString()
- Specified by:
scanString
in interface JSONLexer
scanSymbolUnQuoted
public final String scanSymbolUnQuoted(SymbolTable symbolTable)
- Specified by:
scanSymbolUnQuoted
in interface JSONLexer
scanType
public int scanType(String type)
matchField
public boolean matchField(char[] fieldName)
scanFieldString
public String scanFieldString(char[] fieldName)
stringDefaultValue
public String stringDefaultValue()
scanFieldSymbol
public String scanFieldSymbol(char[] fieldName,
SymbolTable symbolTable)
scanFieldStringArray
public ArrayList<String> scanFieldStringArray(char[] fieldName)
scanFieldStringArray
public Collection<String> scanFieldStringArray(char[] fieldName,
Class<?> type)
scanFieldInt
public int scanFieldInt(char[] fieldName)
scanFieldBoolean
public boolean scanFieldBoolean(char[] fieldName)
scanFieldLong
public long scanFieldLong(char[] fieldName)
scanFieldFloat
public float scanFieldFloat(char[] fieldName)
bytesValue
public byte[] bytesValue()
- Specified by:
bytesValue
in interface JSONLexer
scanFieldDouble
public double scanFieldDouble(char[] fieldName)
scanSymbol
public String scanSymbol(SymbolTable symbolTable)
- Specified by:
scanSymbol
in interface JSONLexer
scanSymbol
public final String scanSymbol(SymbolTable symbolTable,
char quote)
- Specified by:
scanSymbol
in interface JSONLexer
scanTrue
public void scanTrue()
scanSet
public void scanSet()
scanTreeSet
public void scanTreeSet()
scanNullOrNew
public void scanNullOrNew()
scanFalse
public void scanFalse()
scanIdent
public void scanIdent()
scanNumber
public void scanNumber()
- Specified by:
scanNumber
in interface JSONLexer
pos
public final int pos()
- Return the current token's position: a 0-based offset from beginning of the raw input stream (before unicode
translation)
- Specified by:
pos
in interface JSONLexer
stringVal
public final String stringVal()
- The value of a literal token, recorded as a string. For integers, leading 0x and 'l' suffixes are suppressed.
- Specified by:
stringVal
in interface JSONLexer
isRef
public boolean isRef()
symbol
public final String symbol(SymbolTable symbolTable)
- Specified by:
symbol
in interface JSONLexer
integerValue
public Number integerValue()
throws NumberFormatException
- Specified by:
integerValue
in interface JSONLexer
- Throws:
NumberFormatException
longValue
public long longValue()
throws NumberFormatException
- Specified by:
longValue
in interface JSONLexer
- Throws:
NumberFormatException
intValue
public int intValue()
- Specified by:
intValue
in interface JSONLexer
numberString
public final String numberString()
- Specified by:
numberString
in interface JSONLexer
floatValue
public float floatValue()
- Specified by:
floatValue
in interface JSONLexer
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in interface JSONLexer
decimalValue
public Number decimalValue(boolean decimal)
- Specified by:
decimalValue
in interface JSONLexer
decimalValue
public BigDecimal decimalValue()
- Specified by:
decimalValue
in interface JSONLexer
config
public void config(Feature feature,
boolean state)
- Specified by:
config
in interface JSONLexer
isEnabled
public boolean isEnabled(Feature feature)
- Specified by:
isEnabled
in interface JSONLexer
scanISO8601DateIfMatch
public boolean scanISO8601DateIfMatch()
- Specified by:
scanISO8601DateIfMatch
in interface JSONLexer
getCalendar
public Calendar getCalendar()
- Specified by:
getCalendar
in interface JSONLexer
isEOF
public boolean isEOF()
- Specified by:
isEOF
in interface JSONLexer
close
public void close()
- Specified by:
close
in interface JSONLexer
Copyright © 2012
Alibaba Group. All Rights Reserved.