Package org.noggit
Class ObjectBuilder
- java.lang.Object
-
- org.noggit.ObjectBuilder
-
public class ObjectBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description ObjectBuilder(JSONParser parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArrayVal(Object arr, Object val)
void
addKeyVal(Object map, Object key, Object val)
static void
checkEOF(JSONParser p)
Object
endArray(Object arr)
static Object
fromJSON(String json)
consider to usefromJSONStrict(String)
static Object
fromJSONStrict(String json)
likefromJSON(String)
, but also check that there is nothing remaining in the given string after closing bracket.Object
getArray()
Object
getBigNumber()
Object
getBoolean()
Object
getKey()
Object
getLong()
Object
getNull()
Object
getNumber()
Object
getObject()
Object
getString()
Object
getVal()
static Object
getVal(JSONParser parser)
consider to usegetValStrict()
Object
getValStrict()
likegetVal()
, but also check that there is nothing remaining in the given stream after closing bracket.static Object
getValStrict(JSONParser parser)
likegetVal()
, but also check that there is nothing remaining in the given stream after closing bracket.Object
newArray()
Object
newObject()
Object
objectEnd(Object obj)
-
-
-
Constructor Detail
-
ObjectBuilder
public ObjectBuilder(JSONParser parser) throws IOException
- Throws:
IOException
-
-
Method Detail
-
fromJSON
public static Object fromJSON(String json) throws IOException
consider to usefromJSONStrict(String)
- Throws:
IOException
-
fromJSONStrict
public static Object fromJSONStrict(String json) throws IOException
likefromJSON(String)
, but also check that there is nothing remaining in the given string after closing bracket. ThrowsJSONParser.ParseException
otherwise.- Throws:
IOException
-
checkEOF
public static void checkEOF(JSONParser p) throws IOException
- Throws:
IOException
-
getVal
public static Object getVal(JSONParser parser) throws IOException
consider to usegetValStrict()
- Throws:
IOException
-
getValStrict
public static Object getValStrict(JSONParser parser) throws IOException
likegetVal()
, but also check that there is nothing remaining in the given stream after closing bracket. ThrowsJSONParser.ParseException
otherwise.- Throws:
IOException
-
getValStrict
public Object getValStrict() throws IOException
likegetVal()
, but also check that there is nothing remaining in the given stream after closing bracket. ThrowsJSONParser.ParseException
otherwise.- Throws:
IOException
-
getVal
public Object getVal() throws IOException
- Throws:
IOException
-
getString
public Object getString() throws IOException
- Throws:
IOException
-
getLong
public Object getLong() throws IOException
- Throws:
IOException
-
getNumber
public Object getNumber() throws IOException
- Throws:
IOException
-
getBigNumber
public Object getBigNumber() throws IOException
- Throws:
IOException
-
getBoolean
public Object getBoolean() throws IOException
- Throws:
IOException
-
getNull
public Object getNull() throws IOException
- Throws:
IOException
-
newObject
public Object newObject() throws IOException
- Throws:
IOException
-
getKey
public Object getKey() throws IOException
- Throws:
IOException
-
addKeyVal
public void addKeyVal(Object map, Object key, Object val) throws IOException
- Throws:
IOException
-
getObject
public Object getObject() throws IOException
- Throws:
IOException
-
newArray
public Object newArray()
-
addArrayVal
public void addArrayVal(Object arr, Object val) throws IOException
- Throws:
IOException
-
getArray
public Object getArray() throws IOException
- Throws:
IOException
-
-