|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sdicons.json.serializer.marshall.JSONMarshall
public class JSONMarshall
Field Summary | |
---|---|
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 Summary | |
---|---|
JSONMarshall()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public JSONMarshall()
Method Detail |
---|
public JSONObject marshall(boolean aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(byte aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(short aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(char aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(int aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(long aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(float aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(double aValue)
Marshall
marshall
in interface Marshall
public JSONObject marshall(Object aObj) throws MarshallException
Marshall
marshall
in interface Marshall
MarshallException
- An error occured while converting the Java object to JSON.public JSONObject marshallImpl(Object aObj, HashMap aPool) throws MarshallException
MarshallException
public MarshallValue unmarshall(JSONObject aElement) throws MarshallException
Marshall
unmarshall
in interface Marshall
MarshallException
- An error occured while trying to convert the JSON representation into a
Java representation.public Object unmarshallImpl(JSONObject aElement, HashMap aObjectPool) throws MarshallException
MarshallException
public static void requireStringAttribute(JSONObject aElement, String anAttribute) throws MarshallException
MarshallException
public void addHelper(MarshallHelper aHelper)
aHelper
- the custom helper you want to add to the serializer.public void usePojoAccess()
public void useJavaBeanAccess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |