public class ObjectBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
static Object |
createArray(Class<?> clazz,
JsonValue jsonArray)
Create array of Java Object from JSON source include multi-dimension
array.
|
static <T extends Collection<?>> |
createCollection(Class<T> collectionClass,
Type genericType,
JsonValue jsonArray)
Create instance of
collectionClass from JSON representation. |
static <T> T |
createObject(Class<T> clazz,
JsonValue jsonValue)
Create Java Bean from Json Source.
|
static <T extends Map<String,?>> |
createObject(Class<T> mapClass,
Type genericType,
JsonValue jsonObject)
Create instance of
mapClass from JSON representation. |
public static Object createArray(Class<?> clazz, JsonValue jsonArray) throws JsonException
clazz - the Class of target Object.jsonArray - the JSON representation of arrayJsonException - if any errors occurspublic static <T extends Collection<?>> T createCollection(Class<T> collectionClass, Type genericType, JsonValue jsonArray) throws JsonException
collectionClass from JSON representation.
If collectionClass is interface then appropriate
implementation of interface will be returned.collectionClass - collection typegenericType - generic type of collectionjsonArray - the JSON representation of collectionJsonException - if any errors occurspublic static <T extends Map<String,?>> T createObject(Class<T> mapClass, Type genericType, JsonValue jsonObject) throws JsonException
mapClass from JSON representation. If
mapClass is interface then appropriate implementation of
interface will be returned.mapClass - map typegenericType - actual type of mapjsonObject - source JSON objectJsonException - if any errors occurspublic static <T> T createObject(Class<T> clazz, JsonValue jsonValue) throws JsonException
clazz - the Class of target Object.jsonValue - the Json representation.JsonException - if any errors occurs.Copyright © 2012–2016 Codenvy, S.A.. All rights reserved.