Package org.europa.together.application
Class JacksonJsonTools<T>
java.lang.Object
org.europa.together.application.JacksonJsonTools<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
JsonTools<T>
Implementation of JavaScript Object Notation (JSON) processing.
-
Field Summary
Fields inherited from interface org.europa.together.business.JsonTools
FEATURE_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserializeJsonAsList
(String json) Create (deserialize) a list of DomainObject >T< from a JSON String.deserializeJsonAsObject
(String json, Class<T> object) Create (deserialize) a DomainObject >T< from a JSON String.serializeAsJsonObject
(T object) Serialize an DomainObject >T< to an JSON String.
-
Constructor Details
-
JacksonJsonTools
public JacksonJsonTools()Constructor.
-
-
Method Details
-
serializeAsJsonObject
Description copied from interface:JsonTools
Serialize an DomainObject >T< to an JSON String.- Specified by:
serializeAsJsonObject
in interfaceJsonTools<T>
- Parameters:
object
- as >T< DomainObject- Returns:
- JSON as String
- Throws:
JsonProcessingException
-
deserializeJsonAsObject
public T deserializeJsonAsObject(String json, Class<T> object) throws JsonProcessingException, ClassNotFoundException Description copied from interface:JsonTools
Create (deserialize) a DomainObject >T< from a JSON String.- Specified by:
deserializeJsonAsObject
in interfaceJsonTools<T>
- Parameters:
json
- as Stringobject
- as >T<- Returns:
- DomainObject as >T<
- Throws:
JsonProcessingException
ClassNotFoundException
-
deserializeJsonAsList
public List<T> deserializeJsonAsList(String json) throws JsonProcessingException, ClassNotFoundException Description copied from interface:JsonTools
Create (deserialize) a list of DomainObject >T< from a JSON String.- Specified by:
deserializeJsonAsList
in interfaceJsonTools<T>
- Parameters:
json
- as String- Returns:
- List of DomainObjects as >T<
- Throws:
JsonProcessingException
ClassNotFoundException
-