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
,java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClaimsSerializer(java.lang.Class<T> t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
serialize(T holder, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider)
protected void
writeClaim(java.util.Map.Entry<java.lang.String,java.lang.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
-
-
-
-
Constructor Detail
-
ClaimsSerializer
public ClaimsSerializer(java.lang.Class<T> t)
-
-
Method Detail
-
serialize
public void serialize(T holder, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws java.io.IOException
- Specified by:
serialize
in classcom.fasterxml.jackson.databind.ser.std.StdSerializer<T extends ClaimsHolder>
- Throws:
java.io.IOException
-
writeClaim
protected void writeClaim(java.util.Map.Entry<java.lang.String,java.lang.Object> entry, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
Writes 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:
java.io.IOException
- if there is either an underlying I/O problem or encoding issue at format layer
-
-