Class JacksonJsonToPdxConverter
java.lang.Object
org.springframework.geode.data.json.converter.support.JacksonJsonToPdxConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<String,
,org.apache.geode.pdx.PdxInstance[]> JsonToPdxArrayConverter
The
JacksonJsonToPdxConverter
class is an implementation of the JsonToPdxArrayConverter
that is
capable of converting an array of JSON objects into an array of PdxInstances
.- Since:
- 1.3.0
- See Also:
-
JsonNode
ObjectMapper
ArrayNode
ObjectNode
PdxInstance
JsonToPdxArrayConverter
JsonToPdxConverter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.geode.pdx.PdxInstance[]
Converts the givenJSON
containing multiple objects into an array ofPdxInstance
objects.protected JsonToPdxConverter
Returns a reference to the configuredJsonToPdxConverter
used to convert from a single object, JSONString
to PDX (i.e.protected com.fasterxml.jackson.databind.ObjectMapper
Returns a reference to the configured JacksonObjectMapper
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.convert.converter.Converter
andThen
Methods inherited from interface org.springframework.geode.data.json.converter.JsonToPdxArrayConverter
convert
-
Constructor Details
-
JacksonJsonToPdxConverter
public JacksonJsonToPdxConverter()
-
-
Method Details
-
getJsonToPdxConverter
Returns a reference to the configuredJsonToPdxConverter
used to convert from a single object, JSONString
to PDX (i.e. as aPdxInstance
.- Returns:
- a reference to the configured
JsonToPdxConverter
; never null. - See Also:
-
getObjectMapper
@NonNull protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Returns a reference to the configured JacksonObjectMapper
.- Returns:
- a reference to the configured Jackson
ObjectMapper
; never null. - See Also:
-
ObjectMapper
-
convert
Converts the givenJSON
containing multiple objects into an array ofPdxInstance
objects.- Specified by:
convert
in interfaceorg.springframework.core.convert.converter.Converter<String,
org.apache.geode.pdx.PdxInstance[]> - Parameters:
json
-JSON
data to convert.- Returns:
- an array of
PdxInstance
objects from the givenJSON
. - Throws:
IllegalStateException
- if theJSON
does not start with either a JSON array or a JSON object.- See Also:
-
PdxInstance
-