Class TagDefinition
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicPropertySet
-
- com.inductiveautomation.ignition.common.sqltags.TagDefinition
-
- All Implemented Interfaces:
Countable
,Extendable<PropertySet>
,Mergable<PropertySet>
,MutablePropertyValueSource
,ObservablePropertySet
,PropertySet
,PropertyValueSource
,MutableTag
,Tag
,TagNode
,java.io.Serializable
,java.lang.Comparable<Tag>
,java.lang.Iterable<PropertyValue>
- Direct Known Subclasses:
ComplexTagDefinition
public class TagDefinition extends BasicPropertySet implements MutableTag, TagNode, java.io.Serializable
A tag definition is essentially a collection of properties, with various helpers to aid with the wide range of features a tag has.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.common.config.BasicPropertySet
BasicPropertySet.Builder
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
EMPTY
-
-
Constructor Summary
Constructors Constructor Description TagDefinition()
TagDefinition(Tag copy)
Copy constructor makes a deep (including children, if applicable) copy of the given tag.TagDefinition(Tag copy, boolean copyTagChildren)
Special copy constructor that can omit copying the tag's childrenTagDefinition(Tag copy, boolean copyTagChildren, boolean onlyLocalDefinitions)
Copies the tag, optionally with children, and optionally eliminating non-local overrides & extended prop values (for getting just the core udt instance definition)TagDefinition(TagDefinition copy)
TagDefinition(TagDiff diff, TagType type)
TagDefinition(java.lang.String name, TagType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(TagNode tag)
void
addChildren(java.util.Collection<TagNode> tags)
void
applyDiff(TagDiff diff)
int
compareTo(Tag that)
static Tag
fromBase64String(java.lang.String str)
static TagDefinition
fromNodeDescription(NodeDescription info)
<T> T
get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.AccessRightsType
getAccessRights()
Gets the type of access rights for this tagAlarmConfiguration
getAlarmStates()
Returns the list of alarm states for this tagQualifiedValue
getAttribute(Property<?> prop)
Gets the value of the given tag attribute.static PropertySet
getAttributesFrom(Tag copy)
TagNode
getChild(java.lang.String name)
java.util.List<? extends TagNode>
getChildren()
Returns a list of children.QualifiedValue
getCurrentValue()
Returns the value in qualified form- along with quality and timestamp.DataType
getDataType()
Returns the datatype of this tag's value propertyTagEventScripts
getEventScripts()
PropertySet
getExtendedProperties()
java.lang.String
getName()
Returns the name of the tag.<T> T
getOrDefault(Property<T> prop)
TagPermissionsModel
getPermissionModel()
Returns this tags permission model, if anyOverrideMap
getPropertyOverrides()
Gets (or creates) the overridden property tree.TagType
getType()
Returns the type of this tag.boolean
isEnabled()
Returns the enabled bit for this tagboolean
isInherited(Property<?> prop)
Indicates whether the property was inherited from a parent type.Tag
removeChild(java.lang.String name)
void
setAccessRights(AccessRightsType type)
Sets the type of access rights for this tag.void
setAlarmStates(AlarmConfiguration config)
void
setAlarmStates(AlarmStateList states)
This function is used to convert items stored through xml serialization, like transaction groups.void
setAttribute(Property<?> prop, QualifiedValue value)
Sets the value of the given tag attribute.void
setCurrentValue(QualifiedValue value)
Sets this tags value.void
setDataType(DataType type)
Sets the data type for this tag.void
setEnabled(boolean en)
Sets this tag enabled/disabledvoid
setEventScripts(TagEventScripts scripts)
void
setName(java.lang.String name)
Sets the name of this tagvoid
setPermissionModel(TagPermissionsModel model)
void
setRawAttributes(java.util.Map<TagProp,java.lang.Object> value)
void
setType(TagType type)
void
setValue(TagValue tv)
java.lang.String
toBase64String()
-
Methods inherited from class com.inductiveautomation.ignition.common.config.BasicPropertySet
addPropertyChangeListener, addPropertyChangeListener, change, coerceValue, contains, equals, firePropertyChange, getCount, getExtension, getOrElse, getProperties, getRaw, getRawValueMap, getValues, isExtended, iterator, of, remove, removePropertyChangeListener, removePropertyChangeListener, set, set, setDirect, setImpl, setRawValueMap, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.MutablePropertyValueSource
merge
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
extend, newDefaultInstance, newExtension
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertyValueSource
getNonNull, getNonNull
-
-
-
-
Constructor Detail
-
TagDefinition
public TagDefinition()
-
TagDefinition
public TagDefinition(java.lang.String name, TagType type)
-
TagDefinition
public TagDefinition(Tag copy)
Copy constructor makes a deep (including children, if applicable) copy of the given tag. The implementation of the actual tag isn't important, this copy constructor will probe the tag for all pertinent attributes and store copies of them
-
TagDefinition
public TagDefinition(TagDefinition copy)
-
TagDefinition
public TagDefinition(Tag copy, boolean copyTagChildren)
Special copy constructor that can omit copying the tag's children
-
TagDefinition
public TagDefinition(Tag copy, boolean copyTagChildren, boolean onlyLocalDefinitions)
Copies the tag, optionally with children, and optionally eliminating non-local overrides & extended prop values (for getting just the core udt instance definition)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Tag
Returns the name of the tag.
-
getType
public TagType getType()
Description copied from interface:Tag
Returns the type of this tag.
-
getDataType
public DataType getDataType()
Description copied from interface:Tag
Returns the datatype of this tag's value property- Specified by:
getDataType
in interfaceTag
-
isEnabled
public boolean isEnabled()
Description copied from interface:Tag
Returns the enabled bit for this tag
-
getCurrentValue
public QualifiedValue getCurrentValue()
Description copied from interface:Tag
Returns the value in qualified form- along with quality and timestamp.- Specified by:
getCurrentValue
in interfaceTag
-
getAccessRights
public AccessRightsType getAccessRights()
Description copied from interface:Tag
Gets the type of access rights for this tag- Specified by:
getAccessRights
in interfaceTag
-
getPermissionModel
public TagPermissionsModel getPermissionModel()
Description copied from interface:Tag
Returns this tags permission model, if any- Specified by:
getPermissionModel
in interfaceTag
-
getAlarmStates
public AlarmConfiguration getAlarmStates()
Description copied from interface:Tag
Returns the list of alarm states for this tag- Specified by:
getAlarmStates
in interfaceTag
-
getEventScripts
public TagEventScripts getEventScripts()
- Specified by:
getEventScripts
in interfaceTag
-
getExtendedProperties
public PropertySet getExtendedProperties()
-
getAttribute
@Nullable public QualifiedValue getAttribute(Property<?> prop)
Description copied from interface:Tag
Gets the value of the given tag attribute.- Specified by:
getAttribute
in interfaceTag
-
getChildren
public java.util.List<? extends TagNode> getChildren()
Description copied from interface:TagNode
Returns a list of children.- Specified by:
getChildren
in interfaceTagNode
- Returns:
- children, NULL if not a folder.
-
setEnabled
public void setEnabled(boolean en)
Description copied from interface:MutableTag
Sets this tag enabled/disabled- Specified by:
setEnabled
in interfaceMutableTag
-
setName
public void setName(java.lang.String name)
Description copied from interface:MutableTag
Sets the name of this tag- Specified by:
setName
in interfaceMutableTag
-
setType
public void setType(TagType type)
-
setDataType
public void setDataType(DataType type)
Description copied from interface:MutableTag
Sets the data type for this tag. The existing value will most likely be lost.- Specified by:
setDataType
in interfaceMutableTag
-
setAccessRights
public void setAccessRights(AccessRightsType type)
Description copied from interface:MutableTag
Sets the type of access rights for this tag.- Specified by:
setAccessRights
in interfaceMutableTag
-
setPermissionModel
public void setPermissionModel(TagPermissionsModel model)
-
setAlarmStates
public void setAlarmStates(AlarmConfiguration config)
- Specified by:
setAlarmStates
in interfaceMutableTag
-
setEventScripts
public void setEventScripts(TagEventScripts scripts)
- Specified by:
setEventScripts
in interfaceMutableTag
-
setAttribute
public void setAttribute(Property<?> prop, QualifiedValue value) throws java.lang.ClassCastException
Description copied from interface:MutableTag
Sets the value of the given tag attribute. If the type of the argument is incorrect, an ClassCastException will be thrown.- Specified by:
setAttribute
in interfaceMutableTag
- Throws:
java.lang.ClassCastException
-
setCurrentValue
public void setCurrentValue(QualifiedValue value) throws java.lang.ClassCastException
Description copied from interface:MutableTag
Sets this tags value. Will throw an ClassCastException if the value cannot be coerced into the datatype of this tag.- Specified by:
setCurrentValue
in interfaceMutableTag
- Throws:
java.lang.ClassCastException
-
setValue
public void setValue(TagValue tv) throws java.lang.ClassCastException
- Throws:
java.lang.ClassCastException
-
addChild
public void addChild(TagNode tag)
-
addChildren
public void addChildren(java.util.Collection<TagNode> tags)
-
removeChild
public Tag removeChild(java.lang.String name)
-
getChild
public TagNode getChild(java.lang.String name)
-
get
public <T> T get(Property<T> prop)
Description copied from interface:PropertyValueSource
Retrieves the value of the property, or null if this set doesn't contain that property.- Specified by:
get
in interfacePropertyValueSource
- Overrides:
get
in classBasicPropertySet
-
getOrDefault
public <T> T getOrDefault(Property<T> prop)
- Specified by:
getOrDefault
in interfacePropertyValueSource
- Overrides:
getOrDefault
in classBasicPropertySet
- Returns:
- The value for prop or
Property.getDefaultValue()
if not present. Can return null if the value is null.
-
setAlarmStates
public void setAlarmStates(AlarmStateList states)
This function is used to convert items stored through xml serialization, like transaction groups. *
-
getAttributesFrom
public static PropertySet getAttributesFrom(Tag copy)
-
setRawAttributes
public void setRawAttributes(java.util.Map<TagProp,java.lang.Object> value)
-
isInherited
public boolean isInherited(Property<?> prop)
Description copied from interface:PropertySet
Indicates whether the property was inherited from a parent type.- Specified by:
isInherited
in interfacePropertySet
- Overrides:
isInherited
in classBasicPropertySet
-
getPropertyOverrides
public OverrideMap getPropertyOverrides()
Gets (or creates) the overridden property tree. Used for UDTs, property overrides shadow properties in sub tags.
-
compareTo
public int compareTo(Tag that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Tag>
-
toBase64String
public java.lang.String toBase64String() throws java.io.IOException
- Throws:
java.io.IOException
-
fromBase64String
public static Tag fromBase64String(java.lang.String str)
-
fromNodeDescription
public static TagDefinition fromNodeDescription(NodeDescription info)
-
applyDiff
public void applyDiff(TagDiff diff)
-
-