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.JavaTypegetJavaType(String serializedType)Get theJavaTypeinstance from the serialized canonical type.<T> TgetObjectRepresentation(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)Get aTypeReferenceversion of some JSONObjectgetObjectRepresentation(String json, String type, String serializedType)Get an object version of some JSONStringgetSerializedType(Type type)Canonical String version of aJavaTypeinstance based on aTypeinstance.StringgetStringRepresentation(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 aTypeReferenceversion 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 aJavaTypeinstance based on aTypeinstance.- Parameters:
type- TheTypeinstance 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 theJavaTypeinstance from the serialized canonical type.- Parameters:
serializedType- Canonical String version of JavaType- Returns:
- The
JavaTyperepresented by the String
-
-