| Modifier and Type | Field and Description |
|---|---|
static String |
ERR_MISSINGATTR |
static String |
ERR_MISSINGATTRVAL |
static String |
ERR_MISSINGSTRING |
static String |
RNDR_ARR |
static String |
RNDR_ATTR_CLASS |
static String |
RNDR_ATTR_ID |
static String |
RNDR_ATTR_KIND |
static String |
RNDR_ATTR_REF |
static String |
RNDR_ATTR_TYPE |
static String |
RNDR_ATTR_VALUE |
static String |
RNDR_NULL |
static String |
RNDR_OBJ |
static String |
RNDR_OBJREF |
static String |
RNDR_PRIM |
static String |
RNDR_PRTITYP_BOOLEAN |
static String |
RNDR_PRTITYP_BYTE |
static String |
RNDR_PRTITYP_CHAR |
static String |
RNDR_PRTITYP_DOUBLE |
static String |
RNDR_PRTITYP_FLOAT |
static String |
RNDR_PRTITYP_INT |
static String |
RNDR_PRTITYP_LONG |
static String |
RNDR_PRTITYP_SHORT |
| Constructor and Description |
|---|
JSONMarshall() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHelper(MarshallHelper aHelper)
Add custom helper class.
|
JSONObject |
marshall(boolean aValue)
Convert a boolean primitive to JSON.
|
JSONObject |
marshall(byte aValue)
Convert a byte primitive to JSON.
|
JSONObject |
marshall(char aValue)
Convert a char primitive to JSON.
|
JSONObject |
marshall(double aValue)
Convert a double primitive to JSON.
|
JSONObject |
marshall(float aValue)
Convert a float primitive to JSON.
|
JSONObject |
marshall(int aValue)
Convert an int primitive to JSON.
|
JSONObject |
marshall(long aValue)
Convert a long primitive to JSON.
|
JSONObject |
marshall(Object aObj)
Convert a Java object to JSON.
|
JSONObject |
marshall(short aValue)
Convert a short primitive to JSON.
|
JSONObject |
marshallImpl(Object aObj,
HashMap aPool) |
static void |
requireStringAttribute(JSONObject aElement,
String anAttribute) |
MarshallValue |
unmarshall(JSONObject aElement)
Convert a JSON representation to the Java primitive or reference.
|
Object |
unmarshallImpl(JSONObject aElement,
HashMap aObjectPool) |
void |
useJavaBeanAccess()
The objects that fall back on the general object helper will be serialized by
using their JavaBean properties.
|
void |
usePojoAccess()
The objects that fall back on the general object helper will be serialized by
using their fields directly.
|
public static final String RNDR_NULL
public static final String RNDR_OBJ
public static final String RNDR_OBJREF
public static final String RNDR_PRIM
public static final String RNDR_ARR
public static final String RNDR_ATTR_ID
public static final String RNDR_ATTR_KIND
public static final String RNDR_ATTR_TYPE
public static final String RNDR_ATTR_VALUE
public static final String RNDR_ATTR_CLASS
public static final String RNDR_ATTR_REF
public static final String RNDR_PRTITYP_BOOLEAN
public static final String RNDR_PRTITYP_BYTE
public static final String RNDR_PRTITYP_CHAR
public static final String RNDR_PRTITYP_SHORT
public static final String RNDR_PRTITYP_INT
public static final String RNDR_PRTITYP_LONG
public static final String RNDR_PRTITYP_FLOAT
public static final String RNDR_PRTITYP_DOUBLE
public static final String ERR_MISSINGATTR
public static final String ERR_MISSINGATTRVAL
public static final String ERR_MISSINGSTRING
public JSONObject marshall(boolean aValue)
Marshallpublic JSONObject marshall(byte aValue)
Marshallpublic JSONObject marshall(short aValue)
Marshallpublic JSONObject marshall(char aValue)
Marshallpublic JSONObject marshall(int aValue)
Marshallpublic JSONObject marshall(long aValue)
Marshallpublic JSONObject marshall(float aValue)
Marshallpublic JSONObject marshall(double aValue)
Marshallpublic JSONObject marshall(Object aObj) throws MarshallException
Marshallmarshall in interface MarshallMarshallException - An error occured while converting the Java object to JSON.public JSONObject marshallImpl(Object aObj, HashMap aPool) throws MarshallException
MarshallExceptionpublic MarshallValue unmarshall(JSONObject aElement) throws MarshallException
Marshallunmarshall in interface MarshallMarshallException - An error occured while trying to convert the JSON representation into a
Java representation.public Object unmarshallImpl(JSONObject aElement, HashMap aObjectPool) throws MarshallException
MarshallExceptionpublic static void requireStringAttribute(JSONObject aElement, String anAttribute) throws MarshallException
MarshallExceptionpublic void addHelper(MarshallHelper aHelper)
aHelper - the custom helper you want to add to the serializer.public void usePojoAccess()
public void useJavaBeanAccess()
Copyright © 2013. All Rights Reserved.