Package org.camunda.bpm.engine.impl.util
Class JsonUtil
java.lang.Object
org.camunda.bpm.engine.impl.util.JsonUtil
- Author:
- Tassilo Weidner
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addArrayField
(com.google.gson.JsonObject jsonObject, String name, String[] array) static void
addDateField
(com.google.gson.JsonObject jsonObject, String name, Date date) static void
addDefaultField
(com.google.gson.JsonObject jsonObject, String name, boolean defaultValue, Boolean value) static <T> void
addElement
(com.google.gson.JsonArray jsonObject, JsonObjectConverter<T> converter, T value) static void
static void
static void
static void
static void
static void
static void
static <T> void
addField
(com.google.gson.JsonObject jsonObject, String name, JsonObjectConverter<T> converter, T value) static void
addFieldRawValue
(com.google.gson.JsonObject jsonObject, String memberName, Object rawValue) static void
addListField
(com.google.gson.JsonObject jsonObject, String name, List<String> list) static <T> void
addListField
(com.google.gson.JsonObject jsonObject, String name, JsonObjectConverter<T> converter, List<T> list) static void
addNullField
(com.google.gson.JsonObject jsonObject, String name) static com.google.gson.JsonArray
static byte[]
asBytes
(com.google.gson.JsonElement jsonObject) static <T> T
asJavaObject
(com.google.gson.JsonObject jsonObject, JsonObjectConverter<T> converter) static <T> List<T>
asList
(com.google.gson.JsonArray jsonArray, JsonObjectConverter<T> converter) static <T,
S extends List<T>>
SasList
(com.google.gson.JsonArray jsonArray, JsonObjectConverter<T> converter, Supplier<S> listSupplier) asList
(com.google.gson.JsonElement jsonElement) asMap
(com.google.gson.JsonElement jsonElement) static com.google.gson.JsonObject
asObject
(byte[] byteArray) static com.google.gson.JsonObject
static com.google.gson.JsonObject
static Object
asPrimitiveObject
(com.google.gson.JsonPrimitive jsonValue) static String
static String
asStringList
(com.google.gson.JsonElement jsonObject) static com.google.gson.JsonArray
static com.google.gson.Gson
static com.google.gson.JsonObject
static com.google.gson.JsonArray
getArray
(com.google.gson.JsonElement json) static com.google.gson.JsonArray
static boolean
getBoolean
(com.google.gson.JsonObject json, String memberName) static com.google.gson.Gson
static int
static long
static com.google.gson.JsonObject
getObject
(com.google.gson.JsonElement json) static com.google.gson.JsonObject
static Object
getRawObject
(com.google.gson.JsonObject jsonObject, String memberName) static String
getString
(com.google.gson.JsonElement jsonElement) static String
static String
static boolean
protected static Number
parseNumber
(String numberString)
-
Field Details
-
gsonMapper
protected static com.google.gson.Gson gsonMapper
-
-
Constructor Details
-
JsonUtil
public JsonUtil()
-
-
Method Details
-
addFieldRawValue
-
addField
public static <T> void addField(com.google.gson.JsonObject jsonObject, String name, JsonObjectConverter<T> converter, T value) -
addListField
-
addArrayField
-
addDateField
-
addElement
public static <T> void addElement(com.google.gson.JsonArray jsonObject, JsonObjectConverter<T> converter, T value) -
addListField
public static <T> void addListField(com.google.gson.JsonObject jsonObject, String name, JsonObjectConverter<T> converter, List<T> list) -
asJavaObject
public static <T> T asJavaObject(com.google.gson.JsonObject jsonObject, JsonObjectConverter<T> converter) -
addNullField
-
addField
public static void addField(com.google.gson.JsonObject jsonObject, String name, com.google.gson.JsonArray value) -
addField
-
addField
-
addField
-
addField
-
addField
-
addField
-
addDefaultField
-
asBytes
public static byte[] asBytes(com.google.gson.JsonElement jsonObject) -
asObject
public static com.google.gson.JsonObject asObject(byte[] byteArray) -
asObject
-
asObject
-
asStringList
-
asList
public static <T,S extends List<T>> S asList(com.google.gson.JsonArray jsonArray, JsonObjectConverter<T> converter, Supplier<S> listSupplier) -
asList
public static <T> List<T> asList(com.google.gson.JsonArray jsonArray, JsonObjectConverter<T> converter) -
asList
-
asMap
-
asString
-
asString
-
asArray
-
getRawObject
-
asPrimitiveObject
-
parseNumber
-
getBoolean
-
getString
-
getString
-
getString
-
getInt
-
isNull
-
getLong
-
getArray
public static com.google.gson.JsonArray getArray(com.google.gson.JsonObject json, String memberName) -
getArray
public static com.google.gson.JsonArray getArray(com.google.gson.JsonElement json) -
getObject
public static com.google.gson.JsonObject getObject(com.google.gson.JsonObject json, String memberName) -
getObject
public static com.google.gson.JsonObject getObject(com.google.gson.JsonElement json) -
createObject
public static com.google.gson.JsonObject createObject() -
createArray
public static com.google.gson.JsonArray createArray() -
getGsonMapper
public static com.google.gson.Gson getGsonMapper() -
createGsonMapper
public static com.google.gson.Gson createGsonMapper()
-