Package com.alibaba.fastjson.parser
Class JSONScanner
- java.lang.Object
-
- com.alibaba.fastjson.parser.JSONLexerBase
-
- com.alibaba.fastjson.parser.JSONScanner
-
- All Implemented Interfaces:
JSONLexer,Closeable,AutoCloseable
public final class JSONScanner extends JSONLexerBase
- Author:
- wenshao[szujobs@hotmail.com]
-
-
Field Summary
-
Fields inherited from class com.alibaba.fastjson.parser.JSONLexerBase
matchStat
-
Fields inherited from interface com.alibaba.fastjson.parser.JSONLexer
ARRAY, END, EOI, NOT_MATCH, NOT_MATCH_NAME, OBJECT, UNKNOWN, VALUE, VALUE_NULL
-
-
Constructor Summary
Constructors Constructor Description JSONScanner(char[] input, int inputLength)JSONScanner(char[] input, int inputLength, int features)JSONScanner(String input)JSONScanner(String input, int features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddSymbol(int offset, int len, int hash, SymbolTable symbolTable)byte[]bytesValue()booleancharArrayCompare(char[] chars)charcharAt(int index)BigDecimaldecimalValue()intindexOf(char ch, int startIndex)Stringinfo()booleanisEOF()booleanmatchField2(char[] fieldName)charnext()StringnumberString()DatescanDate(char seperator)doublescanDouble(char seperator)booleanscanFieldBoolean(char[] fieldName)DatescanFieldDate(char[] fieldName)intscanFieldInt(char[] fieldName)longscanFieldLong(char[] fieldName)StringscanFieldString(char[] fieldName)String[]scanFieldStringArray(char[] fieldName, int argTypesCount, SymbolTable typeSymbolTable)hsf supportCollection<String>scanFieldStringArray(char[] fieldName, Class<?> type)longscanFieldSymbol(char[] fieldName)intscanInt(char expectNext)booleanscanISO8601DateIfMatch()booleanscanISO8601DateIfMatch(boolean strict)longscanLong(char seperator)StringscanTypeName(SymbolTable symbolTable)booleanseekArrayToItem(int index)intseekObjectToField(long[] fieldNameHash)intseekObjectToField(long fieldNameHash, boolean deepScan)voidskipArray()voidskipArray(boolean valid)voidskipObject()voidskipObject(boolean valid)voidskipString()StringstringVal()The value of a literal token, recorded as a string.char[]sub_chars(int offset, int count)StringsubString(int offset, int count)-
Methods inherited from class com.alibaba.fastjson.parser.JSONLexerBase
close, config, decimalValue, doubleValue, floatValue, getCalendar, getCurrent, getFeatures, getLocale, getTimeZone, integerValue, intValue, isBlankInput, isEnabled, isEnabled, isEnabled, isRef, isWhitespace, longValue, matchField, matchField, matchStat, newCollectionByType, nextIdent, nextToken, nextToken, nextTokenWithChar, nextTokenWithColon, nextTokenWithColon, pos, readString, resetStringPosition, scanBoolean, scanDecimal, scanEnum, scanEnumSymbol, scanFalse, scanFieldBigInteger, scanFieldDecimal, scanFieldDouble, scanFieldFloat, scanFieldFloatArray, scanFieldFloatArray2, scanFieldIntArray, scanFieldUUID, scanFloat, scanHex, scanIdent, scanNullOrNew, scanNullOrNew, scanNumber, scanString, scanString, scanStringArray, scanSymbol, scanSymbol, scanSymbolUnQuoted, scanSymbolWithSeperator, scanTrue, scanType, scanUUID, seekObjectToFieldDeepScan, setFeatures, setLocale, setTimeZone, setToken, skipWhitespace, stringDefaultValue, token, tokenName
-
-
-
-
Method Detail
-
charAt
public final char charAt(int index)
- Specified by:
charAtin classJSONLexerBase
-
next
public final char next()
- Specified by:
nextin interfaceJSONLexer- Specified by:
nextin classJSONLexerBase
-
charArrayCompare
public final boolean charArrayCompare(char[] chars)
-
indexOf
public final int indexOf(char ch, int startIndex)- Specified by:
indexOfin classJSONLexerBase
-
addSymbol
public final String addSymbol(int offset, int len, int hash, SymbolTable symbolTable)
- Specified by:
addSymbolin classJSONLexerBase
-
bytesValue
public byte[] bytesValue()
- Specified by:
bytesValuein interfaceJSONLexer- Specified by:
bytesValuein classJSONLexerBase
-
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:
stringValin interfaceJSONLexer- Specified by:
stringValin classJSONLexerBase
-
subString
public final String subString(int offset, int count)
- Specified by:
subStringin classJSONLexerBase
-
sub_chars
public final char[] sub_chars(int offset, int count)
-
numberString
public final String numberString()
- Specified by:
numberStringin interfaceJSONLexer- Specified by:
numberStringin classJSONLexerBase
-
decimalValue
public final BigDecimal decimalValue()
- Specified by:
decimalValuein interfaceJSONLexer- Specified by:
decimalValuein classJSONLexerBase
-
scanISO8601DateIfMatch
public boolean scanISO8601DateIfMatch()
-
scanISO8601DateIfMatch
public boolean scanISO8601DateIfMatch(boolean strict)
-
isEOF
public boolean isEOF()
- Specified by:
isEOFin classJSONLexerBase
-
scanFieldInt
public int scanFieldInt(char[] fieldName)
- Overrides:
scanFieldIntin classJSONLexerBase
-
scanFieldString
public String scanFieldString(char[] fieldName)
- Overrides:
scanFieldStringin classJSONLexerBase
-
scanFieldDate
public Date scanFieldDate(char[] fieldName)
- Overrides:
scanFieldDatein classJSONLexerBase
-
scanFieldSymbol
public long scanFieldSymbol(char[] fieldName)
- Overrides:
scanFieldSymbolin classJSONLexerBase
-
scanFieldStringArray
public Collection<String> scanFieldStringArray(char[] fieldName, Class<?> type)
- Overrides:
scanFieldStringArrayin classJSONLexerBase
-
scanFieldLong
public long scanFieldLong(char[] fieldName)
- Overrides:
scanFieldLongin classJSONLexerBase
-
scanFieldBoolean
public boolean scanFieldBoolean(char[] fieldName)
- Overrides:
scanFieldBooleanin classJSONLexerBase
-
scanInt
public final int scanInt(char expectNext)
- Specified by:
scanIntin interfaceJSONLexer- Overrides:
scanIntin classJSONLexerBase
-
scanDouble
public double scanDouble(char seperator)
- Specified by:
scanDoublein interfaceJSONLexer- Overrides:
scanDoublein classJSONLexerBase
-
scanLong
public long scanLong(char seperator)
- Specified by:
scanLongin interfaceJSONLexer- Overrides:
scanLongin classJSONLexerBase
-
scanDate
public Date scanDate(char seperator)
- Overrides:
scanDatein classJSONLexerBase
-
info
public String info()
- Specified by:
infoin interfaceJSONLexer- Overrides:
infoin classJSONLexerBase
-
scanFieldStringArray
public String[] scanFieldStringArray(char[] fieldName, int argTypesCount, SymbolTable typeSymbolTable)
Description copied from class:JSONLexerBasehsf support- Overrides:
scanFieldStringArrayin classJSONLexerBase- Returns:
-
matchField2
public boolean matchField2(char[] fieldName)
- Overrides:
matchField2in classJSONLexerBase
-
skipObject
public final void skipObject()
- Overrides:
skipObjectin classJSONLexerBase
-
skipObject
public final void skipObject(boolean valid)
- Overrides:
skipObjectin classJSONLexerBase
-
skipArray
public final void skipArray()
- Overrides:
skipArrayin classJSONLexerBase
-
skipArray
public final void skipArray(boolean valid)
-
skipString
public final void skipString()
-
seekArrayToItem
public boolean seekArrayToItem(int index)
- Overrides:
seekArrayToItemin classJSONLexerBase
-
seekObjectToField
public int seekObjectToField(long fieldNameHash, boolean deepScan)- Overrides:
seekObjectToFieldin classJSONLexerBase
-
seekObjectToField
public int seekObjectToField(long[] fieldNameHash)
- Overrides:
seekObjectToFieldin classJSONLexerBase
-
scanTypeName
public String scanTypeName(SymbolTable symbolTable)
- Specified by:
scanTypeNamein interfaceJSONLexer- Overrides:
scanTypeNamein classJSONLexerBase
-
-