public class JSONMapper extends Object
| Constructor and Description |
|---|
JSONMapper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addHelper(SimpleMapperHelper aHelper)
Add custom helper class.
|
static HelperRepository<SimpleMapperHelper> |
getRepository() |
static Object |
toJava(JSONValue aValue)
Map a JSON representation to a Java object.
|
static Object |
toJava(JSONValue aValue,
Class aPojoClass)
Map a JSON representation to a Java object.
|
static Object |
toJava(JSONValue aValue,
ParameterizedType aGenericType)
Map a JSON representation to a Java object.
|
static JSONValue |
toJSON(Object aPojo)
Map a POJO to the JSON representation.
|
static void |
useJavaBeanAccess()
The objects that fall back on the general object mapper will be mapped by
using their JavaBean properties.
|
static void |
usePojoAccess()
The objects that fall back on the general object mapper will be mapped by
using their fields directly.
|
public static Object toJava(JSONValue aValue, Class aPojoClass) throws MapperException
aValue - The JSON value that has to be mapped.aPojoClass - The class to which the JSON object should be mapped.MapperException - when an error occurs during mapping.public static Object toJava(JSONValue aValue, ParameterizedType aGenericType) throws MapperException
aValue - The JSON value that has to be mapped.aGenericType - A type indication to help the mapper map the JSON text.MapperException - When the JSON text cannot be mapped to POJO.public static Object toJava(JSONValue aValue) throws MapperException
aValue - The JSON value that has to be mapped.MapperException - When the JSON text cannot be mapped to POJO.public static JSONValue toJSON(Object aPojo) throws MapperException
aPojo - to be mapped to JSON.MapperException - If something goes wrong during mapping.public static void addHelper(SimpleMapperHelper aHelper)
aHelper - the custom helper you want to add to the mapper.public static HelperRepository<SimpleMapperHelper> getRepository()
public static void usePojoAccess()
public static void useJavaBeanAccess()
Copyright © 2013. All Rights Reserved.