Package de.mhus.lib.core.json
Class SerializerTransformer
- java.lang.Object
-
- de.mhus.lib.core.MLog
-
- de.mhus.lib.core.json.TransformStrategy
-
- de.mhus.lib.core.json.SerializerTransformer
-
- All Implemented Interfaces:
ILog
public class SerializerTransformer extends TransformStrategy
-
-
Constructor Summary
Constructors Constructor Description SerializerTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ObjectgetValue(org.codehaus.jackson.JsonNode node, TransformHelper helper)ObjectjsonToPojo(org.codehaus.jackson.JsonNode from, Class<?> typex, TransformHelper helper)Transform the json into an object, some implementations need a type hint to create the object.org.codehaus.jackson.JsonNodepojoToJson(Object from, TransformHelper helper)Transform an object into an json representation.protected voidputPojoValue(org.codehaus.jackson.node.ObjectNode out, String name, Object value, TransformHelper helper)-
Methods inherited from class de.mhus.lib.core.json.TransformStrategy
jsonToPojo, jsonToPojo, pojoToJson
-
-
-
-
Method Detail
-
jsonToPojo
public Object jsonToPojo(org.codehaus.jackson.JsonNode from, Class<?> typex, TransformHelper helper) throws de.mhus.lib.errors.NotSupportedException
Description copied from class:TransformStrategyTransform the json into an object, some implementations need a type hint to create the object.- Specified by:
jsonToPojoin classTransformStrategy- Parameters:
from- The object datatypex- The type hint, can also be null. If this is not supportet throw the exceptionhelper- The helper to create objects- Returns:
- The object, can also be null if the object originally was null.
- Throws:
de.mhus.lib.errors.NotSupportedException- Thrown if the object could not be created.
-
pojoToJson
public org.codehaus.jackson.JsonNode pojoToJson(Object from, TransformHelper helper) throws de.mhus.lib.errors.NotSupportedException
Description copied from class:TransformStrategyTransform an object into an json representation.- Specified by:
pojoToJsonin classTransformStrategy- Parameters:
from- The object to transform- Returns:
- The json representation, never return null. Throw the exception if problems occur.
- Throws:
de.mhus.lib.errors.NotSupportedException
-
putPojoValue
protected void putPojoValue(org.codehaus.jackson.node.ObjectNode out, String name, Object value, TransformHelper helper)
-
getValue
public static Object getValue(org.codehaus.jackson.JsonNode node, TransformHelper helper)
-
-