public class SerializeHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJSON(@Nullable org.apache.http.HttpEntity httpEntity,
@Nullable Class<T> type)
Deserialize the object to the given Type T from the json
HttpEntity. |
static <T> T |
fromJSON(@Nullable StreamSource streamSource,
@Nullable Class<T> type)
Deserialize the object to the given Type T from the json
StreamSource. |
static <T> T |
fromXML(@Nullable org.apache.http.HttpEntity httpEntity,
@Nullable Class<T> type)
Deserialize the object to the given Type T from the xml
HttpEntity. |
static <T> T |
fromXML(@Nullable StreamSource streamSource,
@Nullable Class<T> type)
Deserialize the object to the given Type T from the xml
StreamSource. |
static @NotNull String |
toJSON(@Nullable Object object)
Serialize object to json
|
static @NotNull String |
toXML(@Nullable Object object,
@Nullable Class<?> type)
Serialize object to xml
|
@NotNull
public static <T> T fromXML(@Nullable
@Nullable org.apache.http.HttpEntity httpEntity,
@Nullable
@Nullable Class<T> type)
throws ResultException
HttpEntity.T - The type T of the target object.httpEntity - the xml HttpEntitytype - the type T of the target object.HttpEntity.ResultException - a ResultException@NotNull
public static <T> T fromXML(@Nullable
@Nullable StreamSource streamSource,
@Nullable
@Nullable Class<T> type)
throws ResultException
StreamSource.T - The type T of the target object.streamSource - the xml StreamSourcetype - the type T of the target object.StreamSource.ResultException - a ResultException@NotNull
public static <T> T fromJSON(@Nullable
@Nullable org.apache.http.HttpEntity httpEntity,
@Nullable
@Nullable Class<T> type)
throws ResultException
HttpEntity.T - The type T of the target object.httpEntity - the json HttpEntitytype - the type T of the target object.HttpEntity.ResultException - a ResultException@NotNull
public static <T> T fromJSON(@Nullable
@Nullable StreamSource streamSource,
@Nullable
@Nullable Class<T> type)
throws ResultException
StreamSource.T - The type T of the target object.streamSource - the json StreamSourcetype - the type T of the target object.StreamSource.ResultException - a ResultException@NotNull public static @NotNull String toJSON(@Nullable @Nullable Object object) throws IOException
object - the objectStringIOException@NotNull public static @NotNull String toXML(@Nullable @Nullable Object object, @Nullable @Nullable Class<?> type) throws ResultException
object - the objecttype - the object type classStringResultException - an ResultExceptionCopyright © 2017–2020 SoftVision Development GmbH, Fulda, Germany. All rights reserved.