de.cidaas.jwt.impl.PayloadDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cidaas-interceptor-spring-security Show documentation
Show all versions of cidaas-interceptor-spring-security Show documentation
Interceptor for Cidaas Java Spring Clients
package de.cidaas.jwt.impl;
import de.cidaas.jwt.exceptions.JWTDecodeException;
import de.cidaas.jwt.interfaces.Payload;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.util.*;
class PayloadDeserializer extends StdDeserializer {
private final ObjectReader objectReader;
PayloadDeserializer(ObjectReader reader) {
this(null, reader);
}
private PayloadDeserializer(Class> vc, ObjectReader reader) {
super(vc);
this.objectReader = reader;
}
@Override
public Payload deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
Map tree = p.getCodec().readValue(p, new TypeReference