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 betweenJSONParserString
andJSONParserReader
- Author:
- Uriel Chemouni uchemouni@gmail.com
- See Also:
JSONParserMemory
,JSONParserStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JSONParserBase.MSB
-
Field Summary
Fields Modifier and Type Field Description protected boolean
acceptLeadinZero
protected boolean
acceptNaN
protected boolean
acceptNonQuote
protected boolean
acceptSimpleQuote
protected boolean
acceptUselessComma
protected char
c
protected boolean
checkTaillingData
protected boolean
checkTaillingSpace
protected ContainerFactory
containerFactory
static byte
EOI
protected ContentHandler
handler
protected boolean
ignoreControlChar
protected static char
MAX_STOP
protected int
pos
protected JSONParserBase.MSB
sb
protected static boolean[]
stopAll
protected static boolean[]
stopArray
protected static boolean[]
stopKey
protected static boolean[]
stopValue
protected static boolean[]
stopX
protected boolean
useHiPrecisionFloat
protected boolean
useIntegerStorage
protected Object
xo
protected String
xs
-
Constructor Summary
Constructors Constructor Description JSONParserBase(int permissiveMode)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkControleChar()
void
checkLeadinZero()
protected Number
extractFloat()
protected Object
parse(ContainerFactory containerFactory, ContentHandler handler)
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactoryprotected Number
parseNumber(String s)
protected abstract void
read()
Read one char in this.cprotected List<Object>
readArray()
protected Object
readMain(boolean[] stop)
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactoryprotected abstract void
readNoEnd()
protected abstract void
readNQString(boolean[] stop)
protected abstract Object
readNumber(boolean[] stop)
protected Map<String,Object>
readObject()
(package private) abstract void
readS()
store and readprotected abstract void
readString()
protected void
readString2()
protected char
readUnicode(int totalChars)
protected void
skipDigits()
protected void
skipNQString(boolean[] stop)
protected void
skipSpace()
-
-
-
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 IOException
Read one char in this.c- Throws:
IOException
-
readArray
protected List<Object> readArray() throws ParseException, IOException
- Throws:
ParseException
IOException
-
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:
ParseException
IOException
-
readNoEnd
protected abstract void readNoEnd() throws ParseException, IOException
- Throws:
ParseException
IOException
-
readNQString
protected abstract void readNQString(boolean[] stop) throws IOException
- Throws:
IOException
-
readNumber
protected abstract Object readNumber(boolean[] stop) throws ParseException, IOException
- Throws:
ParseException
IOException
-
readObject
protected Map<String,Object> readObject() throws ParseException, IOException
- Throws:
ParseException
IOException
-
readS
abstract void readS() throws IOException
store and read- Throws:
IOException
-
readString
protected abstract void readString() throws ParseException, IOException
- Throws:
ParseException
IOException
-
readString2
protected void readString2() throws ParseException, IOException
- Throws:
ParseException
IOException
-
readUnicode
protected char readUnicode(int totalChars) throws ParseException, IOException
- Throws:
ParseException
IOException
-
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
-
-