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
@JsonSerialize annotation.- Since:
- 9.3
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
com.fasterxml.jackson.databind.JsonSerializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA JSON serialization context attribute containing the current HTTP request. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
acceptJsonFormatVisitor, getSchema, getSchema, handledType, wrapAndThrow, wrapAndThrowMethods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Field Details
-
SERIALIZATION_ATTRIBUTE_HTTP_REQUEST
A JSON serialization context attribute containing the current HTTP request.- See Also:
-
-
Constructor Details
-
MessageKeySerializer
public MessageKeySerializer()Create an instance of the custom serializer.
-
-
Method Details
-
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
-