Class MessageKeySerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<String>
-
- com.pingidentity.sdk.api.authn.util.MessageKeySerializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable,com.fasterxml.jackson.databind.jsonschema.SchemaAware,Serializable
public class MessageKeySerializer extends com.fasterxml.jackson.databind.ser.std.StdSerializer<String>
A Jackson custom serializer that converts a String field that may contain a message key from authn-api-messages.properties or pingfederate-messages.properties into a localized string. If the key is not found in either properties file then the field value is directly serialized to JSON. This serializer can be attached to a model field using the@JsonSerializeannotation.- Since:
- 9.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERIALIZATION_ATTRIBUTE_HTTP_REQUESTA JSON serialization context attribute containing the current HTTP request.
-
Constructor Summary
Constructors Constructor Description MessageKeySerializer()Create an instance of the custom serializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidserialize(String messageKey, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider)The custom serialization implementation.-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
acceptJsonFormatVisitor, getSchema, getSchema, handledType, wrapAndThrow, wrapAndThrow
-
-
-
-
Field Detail
-
SERIALIZATION_ATTRIBUTE_HTTP_REQUEST
public static final String SERIALIZATION_ATTRIBUTE_HTTP_REQUEST
A JSON serialization context attribute containing the current HTTP request.- See Also:
- Constant Field Values
-
-
Method Detail
-
serialize
public void serialize(String messageKey, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
The custom serialization implementation.- Specified by:
serializein classcom.fasterxml.jackson.databind.ser.std.StdSerializer<String>- Parameters:
messageKey- The value of the field to be serialized.jsonGenerator- JSON generator provided by Jackson.serializerProvider- SerializerProvider provided by Jackson.- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
-