Interface AttributeSource
public interface AttributeSource
An 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
Modifier and TypeMethodDescriptiondefault void
contributeAttributes
(com.inductiveautomation.ignition.common.gson.JsonObject jsonObject) Opportunity for anAttributeSource
to contribute attributes to aJsonObject
<T> Optional<T>
Fetch the attribute value with the given attribute path and type from the default sub-sourcedefault <T> Optional<T>
Fetch the attribute value with the given sub-source name, attribute path and typedefault com.inductiveautomation.ignition.common.gson.JsonElement
-
Method Details
-
get
@Nonnull <T> Optional<T> get(@Nonnull String attributePath, @Nonnull Class<T> clazz) throws AttributeSourceException Fetch 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
- theClass
containing the type of the attribute value- Returns:
- an
Optional
containing 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> Optional<T> get(@Nonnull String subSourceName, @Nonnull String attributePath, @Nonnull Class<T> clazz) throws AttributeSourceException Fetch 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
- theClass
containing the type of the attribute value- Returns:
- an
Optional
containing 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
AttributeSource
as aJsonElement
-
contributeAttributes
default void contributeAttributes(@Nonnull com.inductiveautomation.ignition.common.gson.JsonObject jsonObject) Opportunity for anAttributeSource
to contribute attributes to aJsonObject
- Parameters:
jsonObject
- theJsonObject
to which thisAttributeSource
can contribute attributes
-
getSignedAttributesDocument
-