Example usage for com.fasterxml.jackson.databind ObjectMapper readValue

List of usage examples for com.fasterxml.jackson.databind ObjectMapper readValue

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind ObjectMapper readValue.

Prototype

@SuppressWarnings("unchecked")
    public <T> T readValue(byte[] src, JavaType valueType)
            throws IOException, JsonParseException, JsonMappingException 

Source Link

Usage

From source file:com.griddynamics.deming.data.generator.serialization.JsonUtil.java

public static <T> T read(Class<T> tClass, InputStream inputStream) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(inputStream, tClass);
}

From source file:com.cleverCloud.cleverIdea.utils.JacksonUtils.java

public static HashMap jsonToMap(String json) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(json, HashMap.class);
}

From source file:org.envirocar.json.JsonUtil.java

public static Map<?, ?> createJson(InputStream input) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(input, Map.class);
}

From source file:com.mapr.data.sputnik.config.JSONConfigReader.java

public static <T> T readConfig(InputStream input, Class<T> targetClass) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(input, targetClass);
}

From source file:com.shampan.util.MongoID.java

@JsonCreator
public static String fromJSON(String val) throws JsonParseException, JsonMappingException, IOException {
    ObjectMapper mapper = new ObjectMapper();
    MongoID a = mapper.readValue(val, MongoID.class);
    return a.get$oid();
}

From source file:com.codemacro.jcm.util.JsonUtil.java

public static <T> T fromString(String str, Class<T> clazz) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(str, clazz);
}

From source file:com.codemacro.jcm.util.JsonUtil.java

public static <T> T fromString(String str, TypeReference<T> tref) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(str, tref);
}

From source file:com.ibm.dgaasx.utils.JSONUtils.java

public static Object readValue(String value, Class<?> clazz) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(value, clazz);
}

From source file:svnserver.ext.gitlab.mapping.GitLabHookEvent.java

@NotNull
public static GitLabHookEvent parseEvent(@NotNull Reader reader) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(reader, GitLabHookEvent.class);
}

From source file:io.appform.jsonrules.utils.Rule.java

public static Rule create(final String json, final ObjectMapper mapper) throws Exception {
    return new Rule(mapper.readValue(json, Expression.class));
}