Package com.auth0.jwt.impl
Class ClaimsSerializer<T extends ClaimsHolder>
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
com.auth0.jwt.impl.ClaimsSerializer<T>
- Type Parameters:
T
- the type this serializer operates on.
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
,com.fasterxml.jackson.databind.jsonschema.SchemaAware
,Serializable
- Direct Known Subclasses:
HeaderSerializer
,PayloadSerializer
public class ClaimsSerializer<T extends ClaimsHolder>
extends com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
Custom serializer used to write the resulting JWT.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
com.fasterxml.jackson.databind.JsonSerializer.None
-
Field Summary
Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
serialize
(T holder, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) protected void
writeClaim
(Map.Entry<String, Object> entry, com.fasterxml.jackson.core.JsonGenerator gen) Writes the given entry to the JSON representation.Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Constructor Details
-
ClaimsSerializer
-
-
Method Details
-
serialize
public void serialize(T holder, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException - Specified by:
serialize
in classcom.fasterxml.jackson.databind.ser.std.StdSerializer<T extends ClaimsHolder>
- Throws:
IOException
-
writeClaim
protected void writeClaim(Map.Entry<String, Object> entry, com.fasterxml.jackson.core.JsonGenerator gen) throws IOExceptionWrites the given entry to the JSON representation. Custom claim serialization handling can override this method to provide use-case specific serialization. Implementors who override this method must write the field name and the field value.- Parameters:
entry
- The entry that corresponds to the JSON field to writegen
- TheJsonGenerator
to use- Throws:
IOException
- if there is either an underlying I/O problem or encoding issue at format layer
-