public class DefaultJsonUnmarshaller extends Object implements JsonUnmarshaller
JsonUnmarshaller.| Constructor and Description |
|---|
DefaultJsonUnmarshaller()
Default constructor.
|
DefaultJsonUnmarshaller(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Constructor that allows setting of a pre-configured object mapper.
|
| Modifier and Type | Method and Description |
|---|---|
<T> boolean |
isSuitableForUnmarshalling(Class<T> resultClass)
Checks to see if a class is valid for json unmarshalling.
|
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Set a custom ObjectMapper to use during unmarshalling.
|
<T> T |
unmarshal(Class<T> resultClass,
String json)
Unmarshals Json according to the
JsonPath and
JsonProperty annotations in the provided class. |
public DefaultJsonUnmarshaller()
public DefaultJsonUnmarshaller(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
objectMapper - the object mapper to use.public <T> T unmarshal(Class<T> resultClass, String json) throws IOException
JsonUnmarshallerJsonPath and
JsonProperty annotations in the provided class.unmarshal in interface JsonUnmarshallerT - the class type.resultClass - the class to instantiate and populate with result data.json - the json.IOException - if something goes wrong with unmarshalling.public <T> boolean isSuitableForUnmarshalling(Class<T> resultClass)
JsonUnmarshallerisSuitableForUnmarshalling in interface JsonUnmarshallerT - the class type.resultClass - the class to inspect.public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
JsonUnmarshallersetObjectMapper in interface JsonUnmarshallerobjectMapper - the object mapper.Copyright © 2015 Elastic Path Software, Inc. All rights reserved.