Class JSONMarshaller
- java.lang.Object
-
- org.kie.server.api.marshalling.json.JSONMarshaller
-
- All Implemented Interfaces:
Marshaller
public class JSONMarshaller extends Object implements Marshaller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JSONMarshaller.CNFEBehavior
static class
JSONMarshaller.JSONContext
static class
JSONMarshaller.PassThruMapStringObjectDeserializer
static class
JSONMarshaller.PassThruSerializer
Simple utility Serializer which can be used to override replacement of JaxbUnknownAdapter with WrappingObjectSerializer
-
Field Summary
Fields Modifier and Type Field Description protected Set<Class<?>>
classesSet
protected ClassLoader
classLoader
protected DateFormat
dateFormat
protected com.fasterxml.jackson.databind.ObjectMapper
deserializeObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper
objectMapper
-
Fields inherited from interface org.kie.server.api.marshalling.Marshaller
MARSHALLER_PARAMETER_STRICT
-
-
Constructor Summary
Constructors Constructor Description JSONMarshaller(boolean formatDate)
JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader, boolean formatDate)
JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader, boolean formatDate, boolean useStrictJavaBeans)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
protected void
configureMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
void
dispose()
ClassLoader
getClassLoader()
MarshallingFormat
getFormat()
String
marshall(Object objectInput)
String
marshall(Object input, Map<String,Object> parameters)
byte[]
marshallAsBytes(Object objectInput)
protected List<com.fasterxml.jackson.databind.jsontype.NamedType>
prepareCustomClasses(Set<Class<?>> classes)
void
setClassLoader(ClassLoader classLoader)
<T> T
unmarshall(byte[] serializedInput, Class<T> type)
<T> T
unmarshall(String serializedInput, Class<T> type)
protected Object
unwrap(Object data)
protected Object
wrap(Object data)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.kie.server.api.marshalling.Marshaller
unmarshall
-
-
-
-
Field Detail
-
classLoader
protected ClassLoader classLoader
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
deserializeObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper deserializeObjectMapper
-
dateFormat
protected DateFormat dateFormat
-
-
Constructor Detail
-
JSONMarshaller
public JSONMarshaller(boolean formatDate)
-
JSONMarshaller
public JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
-
JSONMarshaller
public JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader, boolean formatDate)
-
JSONMarshaller
public JSONMarshaller(Set<Class<?>> classes, ClassLoader classLoader, boolean formatDate, boolean useStrictJavaBeans)
-
-
Method Detail
-
buildMarshaller
protected void buildMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
-
configureMarshaller
protected void configureMarshaller(Set<Class<?>> classes, ClassLoader classLoader)
-
prepareCustomClasses
protected List<com.fasterxml.jackson.databind.jsontype.NamedType> prepareCustomClasses(Set<Class<?>> classes)
-
marshall
public String marshall(Object input, Map<String,Object> parameters)
- Specified by:
marshall
in interfaceMarshaller
-
marshall
public String marshall(Object objectInput)
- Specified by:
marshall
in interfaceMarshaller
-
marshallAsBytes
public byte[] marshallAsBytes(Object objectInput)
- Specified by:
marshallAsBytes
in interfaceMarshaller
-
unmarshall
public <T> T unmarshall(String serializedInput, Class<T> type)
- Specified by:
unmarshall
in interfaceMarshaller
-
unmarshall
public <T> T unmarshall(byte[] serializedInput, Class<T> type)
- Specified by:
unmarshall
in interfaceMarshaller
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceMarshaller
-
getFormat
public MarshallingFormat getFormat()
- Specified by:
getFormat
in interfaceMarshaller
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
- Specified by:
setClassLoader
in interfaceMarshaller
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceMarshaller
-
-