Package net.minidev.json.parser
Class JSONParserBase
- java.lang.Object
-
- net.minidev.json.parser.JSONParserBase
-
- Direct Known Subclasses:
JSONParserMemory,JSONParserStream
abstract class JSONParserBase extends Object
JSONParserBase is the common code betweenJSONParserStringandJSONParserReader- Author:
- Uriel Chemouni uchemouni@gmail.com
- See Also:
JSONParserMemory,JSONParserStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJSONParserBase.MSB
-
Field Summary
Fields Modifier and Type Field Description protected booleanacceptLeadinZeroprotected booleanacceptNaNprotected booleanacceptNonQuoteprotected booleanacceptSimpleQuoteprotected booleanacceptUselessCommaprotected charcprotected booleancheckTaillingDataprotected booleancheckTaillingSpaceprotected ContainerFactorycontainerFactorystatic byteEOIprotected ContentHandlerhandlerprotected booleanignoreControlCharprotected static charMAX_STOPprotected intposprotected JSONParserBase.MSBsbprotected static boolean[]stopAllprotected static boolean[]stopArrayprotected static boolean[]stopKeyprotected static boolean[]stopValueprotected static boolean[]stopXprotected booleanuseHiPrecisionFloatprotected booleanuseIntegerStorageprotected Objectxoprotected Stringxs
-
Constructor Summary
Constructors Constructor Description JSONParserBase(int permissiveMode)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckControleChar()voidcheckLeadinZero()protected NumberextractFloat()protected Objectparse(ContainerFactory containerFactory, ContentHandler handler)use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactoryprotected NumberparseNumber(String s)protected abstract voidread()Read one char in this.cprotected List<Object>readArray()protected ObjectreadMain(boolean[] stop)use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactoryprotected abstract voidreadNoEnd()protected abstract voidreadNQString(boolean[] stop)protected abstract ObjectreadNumber(boolean[] stop)protected Map<String,Object>readObject()(package private) abstract voidreadS()store and readprotected abstract voidreadString()protected voidreadString2()protected charreadUnicode(int totalChars)protected voidskipDigits()protected voidskipNQString(boolean[] stop)protected voidskipSpace()
-
-
-
Field Detail
-
c
protected char c
-
EOI
public static final byte EOI
- See Also:
- Constant Field Values
-
MAX_STOP
protected static final char MAX_STOP
- See Also:
- Constant Field Values
-
stopAll
protected static boolean[] stopAll
-
stopArray
protected static boolean[] stopArray
-
stopKey
protected static boolean[] stopKey
-
stopValue
protected static boolean[] stopValue
-
stopX
protected static boolean[] stopX
-
containerFactory
protected ContainerFactory containerFactory
-
handler
protected ContentHandler handler
-
sb
protected final JSONParserBase.MSB sb
-
xo
protected Object xo
-
xs
protected String xs
-
pos
protected int pos
-
acceptLeadinZero
protected final boolean acceptLeadinZero
-
acceptNaN
protected final boolean acceptNaN
-
acceptNonQuote
protected final boolean acceptNonQuote
-
acceptSimpleQuote
protected final boolean acceptSimpleQuote
-
acceptUselessComma
protected final boolean acceptUselessComma
-
checkTaillingData
protected final boolean checkTaillingData
-
checkTaillingSpace
protected final boolean checkTaillingSpace
-
ignoreControlChar
protected final boolean ignoreControlChar
-
useHiPrecisionFloat
protected final boolean useHiPrecisionFloat
-
useIntegerStorage
protected final boolean useIntegerStorage
-
-
Method Detail
-
checkControleChar
public void checkControleChar() throws ParseException- Throws:
ParseException
-
checkLeadinZero
public void checkLeadinZero() throws ParseException- Throws:
ParseException
-
extractFloat
protected Number extractFloat() throws ParseException
- Throws:
ParseException
-
parse
protected Object parse(ContainerFactory containerFactory, ContentHandler handler) throws ParseException
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory- Throws:
ParseException
-
parseNumber
protected Number parseNumber(String s) throws ParseException
- Throws:
ParseException
-
read
protected abstract void read() throws IOExceptionRead one char in this.c- Throws:
IOException
-
readArray
protected List<Object> readArray() throws ParseException, IOException
- Throws:
ParseExceptionIOException
-
readMain
protected Object readMain(boolean[] stop) throws ParseException, IOException
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory- Throws:
ParseExceptionIOException
-
readNoEnd
protected abstract void readNoEnd() throws ParseException, IOException- Throws:
ParseExceptionIOException
-
readNQString
protected abstract void readNQString(boolean[] stop) throws IOException- Throws:
IOException
-
readNumber
protected abstract Object readNumber(boolean[] stop) throws ParseException, IOException
- Throws:
ParseExceptionIOException
-
readObject
protected Map<String,Object> readObject() throws ParseException, IOException
- Throws:
ParseExceptionIOException
-
readS
abstract void readS() throws IOExceptionstore and read- Throws:
IOException
-
readString
protected abstract void readString() throws ParseException, IOException- Throws:
ParseExceptionIOException
-
readString2
protected void readString2() throws ParseException, IOException- Throws:
ParseExceptionIOException
-
readUnicode
protected char readUnicode(int totalChars) throws ParseException, IOException- Throws:
ParseExceptionIOException
-
skipDigits
protected void skipDigits() throws IOException- Throws:
IOException
-
skipNQString
protected void skipNQString(boolean[] stop) throws IOException- Throws:
IOException
-
skipSpace
protected void skipSpace() throws IOException- Throws:
IOException
-
-