Example usage for com.fasterxml.jackson.databind JsonDeserializer getClass

List of usage examples for com.fasterxml.jackson.databind JsonDeserializer getClass


In this page you can find the example usage for com.fasterxml.jackson.databind JsonDeserializer getClass.


public final native Class<?> getClass();

Source Link


Returns the runtime class of this Object .


From source file:com.addthis.codec.jackson.CodecBeanDeserializerModifier.java

public JsonDeserializer<?> modifyEnumDeserializer(DeserializationConfig config, JavaType type,
        BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
    JsonDeserializer<?> delegatee = deserializer.getDelegatee();
    if (delegatee != null) {
        JsonDeserializer<?> replacementDelegatee = modifyEnumDeserializer(config, type, beanDesc, delegatee);
        return deserializer.replaceDelegatee(replacementDelegatee);
    } else if (modifyEnum && deserializer.getClass().equals(EnumDeserializer.class)) {
        EnumResolver enumResolver = EnumResolver.constructUnsafe(type.getRawClass(),
        return new CaseIgnoringEnumDeserializer(enumResolver);
    } else {/*w w w  .  jav a2s  .c  om*/
        return deserializer;

From source file:org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.java

 * Configure custom deserializers. Each deserializer is registered for the type
 * returned by {@link JsonDeserializer#handledType()}, which must not be {@code null}.
 * @since 4.3//from  w ww.ja  v a  2s .  c  o  m
 * @see #deserializersByType(Map)
public Jackson2ObjectMapperBuilder deserializers(JsonDeserializer<?>... deserializers) {
    for (JsonDeserializer<?> deserializer : deserializers) {
        Class<?> handledType = deserializer.handledType();
        if (handledType == null || handledType == Object.class) {
            throw new IllegalArgumentException("Unknown handled type in " + deserializer.getClass().getName());
        this.deserializers.put(deserializer.handledType(), deserializer);
    return this;