Package org.pac4j.vertx.core
Class DefaultJsonConverter
- java.lang.Object
-
- org.pac4j.vertx.core.DefaultJsonConverter
-
- All Implemented Interfaces:
JsonConverter
public class DefaultJsonConverter extends java.lang.Object implements JsonConverter
Default eventbus object converter
The serialization strategy is:
- For primitive types (String, Number and Boolean), return as is
- For arrays, convert to JsonArray
- Otherwise, convert to a JsonObject with the class name in the "class" attribute and the serialized form with Jackson in the "value" attribute.
The (de)serialization Jackson process can be customized using the
addMixIn(target, mixinSource)
method
- Since:
- 1.1.0
- Author:
- Michael Remond
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultJsonConverter.BearerAccessTokenMixin
static class
DefaultJsonConverter.OAuth1RequestTokenMixin
static class
DefaultJsonConverter.TokenMixin
static class
DefaultJsonConverter.ValueMixin
-
Constructor Summary
Constructors Constructor Description DefaultJsonConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decodeObject(java.lang.Object value)
Decode the given object encoded with the encodeObject method.java.lang.Object
encodeObject(java.lang.Object value)
Encode the given object in a compatible form for the event bus.static JsonConverter
getInstance()
-
-
-
Method Detail
-
getInstance
public static JsonConverter getInstance()
-
encodeObject
public java.lang.Object encodeObject(java.lang.Object value)
Description copied from interface:JsonConverter
Encode the given object in a compatible form for the event bus.- Specified by:
encodeObject
in interfaceJsonConverter
- Parameters:
value
- the value to encode- Returns:
- the encoded object
-
decodeObject
public java.lang.Object decodeObject(java.lang.Object value)
Description copied from interface:JsonConverter
Decode the given object encoded with the encodeObject method.- Specified by:
decodeObject
in interfaceJsonConverter
- Parameters:
value
- the value to decode- Returns:
- the decoded object
-
-