|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.skaringa.json.parser.JsonParser
public class JsonParser
Parse JSON into Java objects.
| Constructor Summary | |
|---|---|
JsonParser(java.io.Reader reader,
java.lang.Class rootType,
java.lang.ClassLoader classLoader)
Create a new parser. |
|
JsonParser(java.io.Reader reader,
java.lang.Class rootType,
java.util.Map propertyMap,
java.lang.ClassLoader classLoader)
Create a new parser. |
|
| Method Summary | |
|---|---|
java.lang.ClassLoader |
getClassLoader()
Get the class loader used to load classes during deserialization. |
java.lang.Object |
getObject()
Get the deserialized object tree. |
void |
process()
Parse the JSON and instantiate the Java object tree. |
void |
setClassLoader(java.lang.ClassLoader loader)
Set the class loader used to load classes during deserialization. |
void |
setRootType(java.lang.Class type)
Set the type of the root object to be deserialized. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonParser(java.io.Reader reader,
java.lang.Class rootType,
java.lang.ClassLoader classLoader)
reader - The reader that produces the JSON.rootType - The type of the root object. If null, then LinkedList or HashMap
is used.classLoader - The class loader used to instantiate the Java objects.
public JsonParser(java.io.Reader reader,
java.lang.Class rootType,
java.util.Map propertyMap,
java.lang.ClassLoader classLoader)
reader - The reader that produces the JSON.rootType - The type of the root object. If null, then LinkedList or HashMap
is used.propertyMap - The properties to control the parsing.classLoader - The class loader used to instantiate the Java objects.| Method Detail |
|---|
public void process()
throws java.io.IOException,
DeserializerException
java.io.IOException - If the reader fails.
DeserializerException - If the desrialization failes (e.g. because of invalid JSON).public void setRootType(java.lang.Class type)
type - The class of the root object.public java.lang.Object getObject()
public void setClassLoader(java.lang.ClassLoader loader)
loader - The class loader.public java.lang.ClassLoader getClassLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||