Class GsonFieldResolver<T>
java.lang.Object
com.inductiveautomation.ignition.gateway.dataroutes.GsonFieldResolver<T>
- All Implemented Interfaces:
FilterSortPageHelper.FieldResolver<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.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 asJsonPath
and resolve deeply nested fields.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.
-
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 asJsonPath
and resolve deeply nested fields. -
getFieldValue
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 aJsonPath
and the child element will be resolved usingJsonUtilities.read(JsonElement, String)
.- Specified by:
getFieldValue
in interfaceFilterSortPageHelper.FieldResolver<T>
-