|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.module.SimpleModule
com.genesyslab.platform.json.jackson2.PSDKCommonModule
com.genesyslab.platform.json.jackson2.outbounddesktop.OutboundDesktopModule
public class OutboundDesktopModule
PSDK module for Jackson ObjectMapper that describes how to convert PSDK messages to/from JSON.
Example:
// create jackson's JSONizator ObjectMapper mapper = new ObjectMapper(); // register our new PSDK module mapper.registerModule( new OutboundDesktopModule() ); // create PSDK message ErrorMessage request = ErrorMessage.create(); // request.set ... // serialize message String json = mapper.writeValueAsString(request); // deserialize message ErrorMessage msg = mapper.readValue(json, ErrorMessage.class);NOTE: the module changes ObjectMapper features when it is registering as shown in commented lines:
ObjectMapper mapper = new ObjectMapper(); mapper.register( new OutboundDesktopModule() ); // mapper.setSerializationInclusion(Include.NON_NULL); // mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); // mapper.setDateFormat(new ISO8601DateFormatWithMilliseconds());so if you have own vision how it should be configured then configure it after the module will be registered.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module |
---|
com.fasterxml.jackson.databind.Module.SetupContext |
Field Summary |
---|
Fields inherited from class com.genesyslab.platform.json.jackson2.PSDKCommonModule |
---|
enabledMessageNameSerialization |
Fields inherited from class com.fasterxml.jackson.databind.module.SimpleModule |
---|
_abstractTypes, _deserializerModifier, _deserializers, _keyDeserializers, _keySerializers, _mixins, _name, _namingStrategy, _serializerModifier, _serializers, _subtypes, _valueInstantiators, _version |
Constructor Summary | |
---|---|
OutboundDesktopModule()
Create new instance of the jackson module. |
|
OutboundDesktopModule(boolean enableMessageNameSerialization)
Create new instance of the jackson module. |
Method Summary | |
---|---|
static void |
init(PSDKCommonModule module)
For internal use only |
static boolean |
isAvailable()
Checks if the appropriate protocol jar file is available according to the classpath. |
static void |
setup(com.fasterxml.jackson.databind.Module.SetupContext context)
Do not call it directly. |
void |
setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
Do not call it directly. |
Methods inherited from class com.genesyslab.platform.json.jackson2.PSDKCommonModule |
---|
createUnknownMessage, getMarkerClass, getMessageClass, isProtocolAvailable |
Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule |
---|
addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setValueInstantiators, version |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OutboundDesktopModule()
public OutboundDesktopModule(boolean enableMessageNameSerialization)
enableMessageNameSerialization
- flag enables message name serialization
(it is disabled by default).Method Detail |
---|
public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
setupModule
in class PSDKCommonModule
public static void init(PSDKCommonModule module)
public static void setup(com.fasterxml.jackson.databind.Module.SetupContext context)
public static boolean isAvailable()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |