|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.javajson.converter.Converter
public class Converter
Converts java objects to json based on bean-style fields and classes/interfaces (to filter)
Field Summary | |
---|---|
static Converter |
instance
|
protected Logger |
log
|
Method Summary | |
---|---|
Object |
fromJson(JsonObject json)
|
static Converter |
getInstance()
|
JsonObject |
toJson(Object o)
Convenience method for converting objects without a predefined mapper. |
JsonObject |
toJson(Object o,
boolean flat)
Convenience method for converting objects without a predefined mapper. |
JsonObject |
toJson(Object o,
Class cls)
Convenience method for converting objects without a predefined mapper. |
JsonArray |
toJsonArray(Collection c)
Convenience method for converting objects without a predefined mapper. |
JsonArray |
toJsonArray(Collection c,
boolean flat)
Convenience method for converting objects without a predefined mapper. |
JsonArray |
toJsonArray(Collection c,
Class cls)
Convenience method for converting collections without a predefined mapper. |
JsonArray |
toJsonArray(Collection c,
Class cls,
boolean flat)
Convenience method for converting collections without a predefined mapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Logger log
public static final Converter instance
Method Detail |
---|
public static Converter getInstance()
public Object fromJson(JsonObject json) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
ClassNotFoundException
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
public JsonObject toJson(Object o) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
-
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonObject toJson(Object o, boolean flat) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
- flat
- Don't look at non basic fields (numbers, strings, dates,
boolean)
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonObject toJson(Object o, Class cls) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
- cls
- The class to read the fields from
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection c) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
-
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection c, boolean flat) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
-
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection c, Class cls) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
- cls
- The class to read the fields from
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection c, Class cls, boolean flat) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
o
- cls
- The class to read the fields from
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |