Package software.amazon.jsii
Class JsiiObjectMapper
java.lang.Object
software.amazon.jsii.JsiiObjectMapper
Provides a correctly configured JSON processor for handling JSII requests and responses.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapperAn ObjectMapper that can be used to serialize and deserialize JSII requests and responses. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TtreeToValue(com.fasterxml.jackson.databind.JsonNode tree, NativeType<T> valueType) Similar to calling JsiiObjectMapper.INSTANCE.treeToValue, but handles a null JsonNode argument well, and throws JsiiError instead of JsonProcessingException.static <T extends com.fasterxml.jackson.databind.JsonNode>
TvalueToTree(Object value) Similar to calling JsiiObjectMapper.INSTANCE.valueToTree, but handles a null argument well by returning null.
-
Field Details
-
INSTANCE
public static final com.fasterxml.jackson.databind.ObjectMapper INSTANCEAn ObjectMapper that can be used to serialize and deserialize JSII requests and responses.
-
-
Method Details
-
treeToValue
public static <T> T treeToValue(com.fasterxml.jackson.databind.JsonNode tree, NativeType<T> valueType) Similar to calling JsiiObjectMapper.INSTANCE.treeToValue, but handles a null JsonNode argument well, and throws JsiiError instead of JsonProcessingException.- Type Parameters:
T- expected type- Parameters:
tree- the JSON object to parsevalueType- the expected type value type- Returns:
- the deserialized value
-
valueToTree
Similar to calling JsiiObjectMapper.INSTANCE.valueToTree, but handles a null argument well by returning null.- Type Parameters:
T- expected JSON type- Parameters:
value- the value to serialize- Returns:
- the JSON object
-