Example usage for com.fasterxml.jackson.databind DeserializationContext getAnnotationIntrospector

List of usage examples for com.fasterxml.jackson.databind DeserializationContext getAnnotationIntrospector

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind DeserializationContext getAnnotationIntrospector.

Prototype

public final AnnotationIntrospector getAnnotationIntrospector() 

Source Link

Usage

From source file:com.bitsofproof.dropwizard.supernode.jackson.TransactionDeserializer.java

@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)
        throws JsonMappingException {
    if (property != null) {
        JsonFormat.Value format = ctxt.getAnnotationIntrospector().findFormat((Annotated) property.getMember());
        if (format != null && Objects.equals(TransactionSerializer.BASE64_FORMAT, format.getPattern())) {
            return new Base64TransactionDeserializer();
        }// w ww.  java 2  s .com
    }

    return new HexTransactionDeserializer();
}

From source file:org.hyperledger.jackson.TransactionDeserializer.java

@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)
        throws JsonMappingException {
    if (property != null) {
        JsonFormat.Value format = ctxt.getAnnotationIntrospector().findFormat(property.getMember());
        if (format != null && Objects.equals(TransactionSerializer.BASE64_FORMAT, format.getPattern())) {
            return new Base64TransactionDeserializer(formatter);
        }// w  ww.  j  a v  a  2 s.  c  o m
    }

    return new HexTransactionDeserializer(formatter);
}