Class GsonFieldResolver<T>

java.lang.Object
com.inductiveautomation.ignition.gateway.dataroutes.GsonFieldResolver<T>
All Implemented Interfaces:
FilterSortPageHelper.FieldResolver<T>

public class GsonFieldResolver<T> extends Object implements FilterSortPageHelper.FieldResolver<T>
  • Method Details

    • create

      public static <T> FilterSortPageHelper.FieldResolver<T> create(com.inductiveautomation.ignition.common.gson.Gson gson)
      Create a field resolver that will use the given gson object to serialize items and look for top-level keys.
    • createDeep

      public static <T> FilterSortPageHelper.FieldResolver<T> createDeep(com.inductiveautomation.ignition.common.gson.Gson gson)
      Create a field resolver that will use the given gson object to serialize items and treat field names as JsonPath and resolve deeply nested fields.
    • getFieldValue

      public Optional<Object> getFieldValue(T object, String fieldName)
      Resolves the field by converting the object to JSON and then looking for a child element of the given field name. If this resolver was created as a "deep" resolver, the field name will be parsed as a JsonPath and the child element will be resolved using JsonUtilities.read(JsonElement, String).
      Specified by:
      getFieldValue in interface FilterSortPageHelper.FieldResolver<T>