public class ObjectDecoder extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
decode(Class baseType,
JSONObject jsonObj)
A simple JSON object decoder for one-shot objects.
|
static Object |
decode(Class baseType,
JSONObject obj,
TypeResolver resolver)
Produce the Java object described by a particular JSON object
descriptor.
|
static Object |
decode(Class baseType,
String str)
A simple JSON string decoder for one-shot objects.
|
public static Object decode(Class baseType, JSONObject obj, TypeResolver resolver)
baseType
- The desired class of the resulting Java object. The
result will not necessarily be of this class, but will be assignable
to a variable of this class.obj
- The parsed JSON object descriptor to be decoded.resolver
- An object mapping type tag strings to Java classes.public static Object decode(Class baseType, JSONObject jsonObj)
decode(Class,JSONObject,TypeResolver)
method, using the
StaticTypeResolver
to resolve type tags.baseType
- The desired class of the resulting Java object. The
result will not necessarily be of this class, but will be assignable
to a variable of this class.jsonObj
- A JSON object describing the object to decode.public static Object decode(Class baseType, String str)
decode(Class,JSONObject,TypeResolver)
method, using the StaticTypeResolver
to resolve type tags.baseType
- The desired class of the resulting Java object. The
result will not necessarily be of this class, but will be assignable
to a variable of this class.str
- A JSON string describing the object.Copyright © 2017. All rights reserved.