|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.javajson.converter.Mapper
public class Mapper
Maps objects to a json object TODO: addMapper as: String field, String alias to map to an existing mapper TODO: addMapper to map a field to objAtField.fieldName and maybe rename the field too
Field Summary | |
---|---|
static Mapper |
DefaultMapper
Default mapper that can be used to map object all the way down the tree. |
protected Logger |
log
|
Method Summary | |
---|---|
JsonObject |
toJson(Object obj)
|
JsonObject |
toJson(Object obj,
boolean flat)
|
protected JsonObject |
toJson(Object obj,
Class cls)
Maps an object to json based on a class, this method only works when using the default mapper and is meant to be called via convenience method on Converter. |
protected JsonObject |
toJson(Object obj,
Class cls,
boolean flat)
|
JsonArray |
toJsonArray(Collection col)
|
JsonArray |
toJsonArray(Collection col,
boolean flat)
|
protected JsonArray |
toJsonArray(Collection col,
Class cls)
Maps a collection to jsonarray based on a class, this method only works when using the default mapper and is meant to be called via convenience method on Converter. |
protected JsonArray |
toJsonArray(Collection col,
Class cls,
boolean flat)
Maps a collection to jsonarray based on a class, this method only works when using the default mapper and is meant to be called via convenience method on Converter. |
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 Mapper DefaultMapper
Method Detail |
---|
protected JsonObject toJson(Object obj, Class cls) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
obj
- The object to convert to jsoncls
- locale
-
InvocationTargetException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
IllegalAccessException
IllegalArgumentException
protected JsonObject toJson(Object obj, Class cls, boolean flat) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public JsonObject toJson(Object obj, boolean flat) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public JsonObject toJson(Object obj) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
protected JsonArray toJsonArray(Collection col, Class cls) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
col
- cls
-
InvocationTargetException
IllegalAccessException
IllegalArgumentException
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
protected JsonArray toJsonArray(Collection col, Class cls, boolean flat) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
col
- cls
-
InvocationTargetException
IllegalAccessException
IllegalArgumentException
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection col) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public JsonArray toJsonArray(Collection col, boolean flat) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |