public class JSONTransformer extends Object implements FunctionTransformer
Map
or List
unless overriden by getJsonConfig()
objClass
is String.
MapValueLookupTransformer
to process the output of this Transformer
it can be handy
TODO: Add unit test case for objClass
specified scenario + Collection Vs Non-Collection scenariosConstructor and Description |
---|
JSONTransformer() |
JSONTransformer(Class objClass) |
Modifier and Type | Method and Description |
---|---|
net.sf.json.JsonConfig |
getJsonConfig()
Optional
JsonConfig |
Class |
getObjClass()
If Provided will be used to convert JSON string to this object.
If type String then will return a JSON String. |
boolean |
isReturnNullOnException() |
void |
setJsonConfig(net.sf.json.JsonConfig jsonConfig)
Optional
JsonConfig |
void |
setObjClass(Class objClass)
If Provided will be used to convert JSON string to this object.
If type String then will return a JSON String. |
void |
setReturnNullOnException(boolean returnNullOnException) |
Object |
transform(Object json) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
public JSONTransformer()
public JSONTransformer(Class objClass)
public Object transform(Object json)
transform
in interface org.apache.commons.collections.Transformer
public net.sf.json.JsonConfig getJsonConfig()
JsonConfig
public void setJsonConfig(net.sf.json.JsonConfig jsonConfig)
JsonConfig
public Class getObjClass()
public void setObjClass(Class objClass)
public boolean isReturnNullOnException()
public void setReturnNullOnException(boolean returnNullOnException)
Copyright © 2018. All rights reserved.