public class SerializeHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJSON(org.apache.http.HttpEntity httpEntity,
Class<T> type)
Deserialize the object to the given Type T from the json
HttpEntity. |
static <T> T |
fromJSON(StreamSource streamSource,
Class<T> type)
Deserialize the object to the given Type T from the json
StreamSource. |
static <T> T |
fromXML(org.apache.http.HttpEntity httpEntity,
Class<T> type)
Deserialize the object to the given Type T from the xml
HttpEntity. |
static <T> T |
fromXML(StreamSource streamSource,
Class<T> type)
Deserialize the object to the given Type T from the xml
StreamSource. |
static String |
toJSON(Object object)
Serialize object to json
|
static String |
toXML(Object object,
Class type)
Serialize object to xml
|
public static <T> T fromXML(org.apache.http.HttpEntity httpEntity,
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 ResultExceptionpublic static <T> T fromXML(StreamSource streamSource, 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 ResultExceptionpublic static <T> T fromJSON(org.apache.http.HttpEntity httpEntity,
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 ResultExceptionpublic static <T> T fromJSON(StreamSource streamSource, 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 ResultExceptionpublic static String toJSON(Object object)
object - the objectStringpublic static String toXML(Object object, Class type) throws ResultException
object - the objecttype - the object type classStringResultException - an ResultExceptionCopyright © 2017–2019 SoftVision Development GmbH, Fulda, Germany. All rights reserved.