Interface AttributeSource
-
public interface AttributeSourceAn AttributeSource provides access to attributes through an attribute path. For example, an AttributeSource backed by an XML document may use XPaths whereas an AttributeSource backed by a JSON document may use Json Paths.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcontributeAttributes(com.inductiveautomation.ignition.common.gson.JsonObject jsonObject)Opportunity for anAttributeSourceto contribute attributes to aJsonObject<T> java.util.Optional<T>get(java.lang.String attributePath, java.lang.Class<T> clazz)Fetch the attribute value with the given attribute path and type from the default sub-sourcedefault <T> java.util.Optional<T>get(java.lang.String subSourceName, java.lang.String attributePath, java.lang.Class<T> clazz)Fetch the attribute value with the given sub-source name, attribute path and typejava.util.Optional<java.lang.String>getSignedAttributesDocument()default com.inductiveautomation.ignition.common.gson.JsonElementtoJsonTree()
-
-
-
Method Detail
-
get
@Nonnull <T> java.util.Optional<T> get(@Nonnull java.lang.String attributePath, @Nonnull java.lang.Class<T> clazz) throws AttributeSourceExceptionFetch the attribute value with the given attribute path and type from the default sub-source- Type Parameters:
T- the type of the attribute value- Parameters:
attributePath- the path to the attributeclazz- theClasscontaining the type of the attribute value- Returns:
- an
Optionalcontaining the attribute value or an empty Optional if no attribute exists with the given path - Throws:
AttributeSourceException- if there is an unexpected problem fetching an attribute value with the given type at the given attribute path
-
get
@Nonnull default <T> java.util.Optional<T> get(@Nonnull java.lang.String subSourceName, @Nonnull java.lang.String attributePath, @Nonnull java.lang.Class<T> clazz) throws AttributeSourceExceptionFetch the attribute value with the given sub-source name, attribute path and type- Type Parameters:
T- the type of the attribute value- Parameters:
subSourceName- the name of the sub-source of the attribute with the given pathattributePath- the path to the attributeclazz- theClasscontaining the type of the attribute value- Returns:
- an
Optionalcontaining the attribute value or an empty Optional if no attribute exists with the given path - Throws:
AttributeSourceException- if there is an unexpected problem fetching an attribute value with the given type at the given attribute path
-
toJsonTree
@Nonnull default com.inductiveautomation.ignition.common.gson.JsonElement toJsonTree()
- Returns:
- the representation of this
AttributeSourceas aJsonElement
-
contributeAttributes
default void contributeAttributes(@Nonnull com.inductiveautomation.ignition.common.gson.JsonObject jsonObject)Opportunity for anAttributeSourceto contribute attributes to aJsonObject- Parameters:
jsonObject- theJsonObjectto which thisAttributeSourcecan contribute attributes
-
getSignedAttributesDocument
@Nonnull java.util.Optional<java.lang.String> getSignedAttributesDocument()
- Returns:
- an
Optionalcontaining the underlying attribute source document which was signed by the attribute authority or an emptyOptionalif it is not available
-
-