Example usage for com.fasterxml.jackson.annotation PropertyAccessor FIELD

List of usage examples for com.fasterxml.jackson.annotation PropertyAccessor FIELD

Introduction

In this page you can find the example usage for com.fasterxml.jackson.annotation PropertyAccessor FIELD.

Prototype

PropertyAccessor FIELD

To view the source code for com.fasterxml.jackson.annotation PropertyAccessor FIELD.

Click Source Link

Document

Field refers to fields of regular Java objects.

Usage

From source file:org.verdictdb.core.scrambling.ScrambleMeta.java

public static ScrambleMeta fromJsonString(String jsonString) {
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
    objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    try {//from w  w  w .  j av  a 2s .  co  m
        ScrambleMeta meta = objectMapper.readValue(jsonString, ScrambleMeta.class);
        return meta;
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}