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 voidaddArrayVal(Object arr, Object val)voidaddKeyVal(Object map, Object key, Object val)static voidcheckEOF(JSONParser p)ObjectendArray(Object arr)static ObjectfromJSON(String json)consider to usefromJSONStrict(String)static ObjectfromJSONStrict(String json)likefromJSON(String), but also check that there is nothing remaining in the given string after closing bracket.ObjectgetArray()ObjectgetBigNumber()ObjectgetBoolean()ObjectgetKey()ObjectgetLong()ObjectgetNull()ObjectgetNumber()ObjectgetObject()ObjectgetString()ObjectgetVal()static ObjectgetVal(JSONParser parser)consider to usegetValStrict()ObjectgetValStrict()likegetVal(), but also check that there is nothing remaining in the given stream after closing bracket.static ObjectgetValStrict(JSONParser parser)likegetVal(), but also check that there is nothing remaining in the given stream after closing bracket.ObjectnewArray()ObjectnewObject()ObjectobjectEnd(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.ParseExceptionotherwise.- 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.ParseExceptionotherwise.- 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.ParseExceptionotherwise.- 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
-
-