Class ChangeTransformerHelper
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.mapping.ChangeTransformerHelper
-
public class ChangeTransformerHelper extends Object
Helper class for dealing with JSON serialized object state (primarily inChangeDetail
).- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description ChangeTransformerHelper(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JavaType
getJavaType(String serializedType)
Get theJavaType
instance from the serialized canonical type.<T> T
getObjectRepresentation(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Get aTypeReference
version of some JSONObject
getObjectRepresentation(String json, String type, String serializedType)
Get an object version of some JSONString
getSerializedType(Type type)
Canonical String version of aJavaType
instance based on aType
instance.String
getStringRepresentation(Object item)
The message information to convert to JSON string.
-
-
-
Method Detail
-
getObjectRepresentation
public Object getObjectRepresentation(String json, String type, String serializedType)
Get an object version of some JSON- Parameters:
json
- The JSON to deserializetype
- The object type used during deserializationserializedType
- Canonical String version of theJavaType
- Returns:
- the deserialized object
-
getObjectRepresentation
public <T> T getObjectRepresentation(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Get aTypeReference
version of some JSON- Parameters:
json
- The JSON to deserialize- Returns:
- the deserialized type reference object
-
getSerializedType
public String getSerializedType(Type type)
Canonical String version of aJavaType
instance based on aType
instance.- Parameters:
type
- TheType
instance to convert- Returns:
- Canonical String version of JavaType
-
getStringRepresentation
public String getStringRepresentation(Object item)
The message information to convert to JSON string.- Parameters:
item
- The message information- Returns:
- The JSON representation
-
getJavaType
public com.fasterxml.jackson.databind.JavaType getJavaType(String serializedType)
Get theJavaType
instance from the serialized canonical type.- Parameters:
serializedType
- Canonical String version of JavaType- Returns:
- The
JavaType
represented by the String
-
-