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

public class JacksonJsonToPdxConverter extends Object implements 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:
  • Constructor Details

    • JacksonJsonToPdxConverter

      public JacksonJsonToPdxConverter()
  • Method Details

    • getJsonToPdxConverter

      @NonNull protected JsonToPdxConverter getJsonToPdxConverter()
      Returns a reference to the configured JsonToPdxConverter used to convert from a single object, JSON String to PDX (i.e. as a PdxInstance.
      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 Jackson ObjectMapper.
      Returns:
      a reference to the configured Jackson ObjectMapper; never null.
      See Also:
      • ObjectMapper
    • convert

      @Nullable public org.apache.geode.pdx.PdxInstance[] convert(String json)
      Converts the given JSON containing multiple objects into an array of PdxInstance objects.
      Specified by:
      convert in interface org.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 given JSON.
      Throws:
      IllegalStateException - if the JSON does not start with either a JSON array or a JSON object.
      See Also:
      • PdxInstance