Class AbstractTag
- java.lang.Object
-
- com.inductiveautomation.ignition.common.sqltags.tags.AbstractTag
-
- All Implemented Interfaces:
MutableTag
,Tag
,java.lang.Comparable<Tag>
- Direct Known Subclasses:
AbstractClientTag
,FolderTag
public abstract class AbstractTag extends java.lang.Object implements MutableTag
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessRightsType
accessRights
protected java.util.Map<Property<?>,java.lang.Object>
attributes
protected boolean
enabled
protected TagEventScripts
eventScripts
protected java.lang.String
name
protected TagPermissionsModel
permissionModel
protected DataType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTag()
protected
AbstractTag(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(Tag child)
protected QualifiedValue
coerceValue(QualifiedValue value)
Coerces the value inside the argument QualifiedValue to this tag's datatype, if that value is not null.int
compareTo(Tag that)
AccessRightsType
getAccessRights()
Gets the type of access rights for this tagQualifiedValue
getAttribute(Property<?> prop)
Gets the value of the given tag attribute.Tag
getChild(java.lang.String name)
java.util.List<? extends Tag>
getChildren()
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()
java.lang.String
getName()
Returns the name of the tag.TagPermissionsModel
getPermissionModel()
Returns this tags permission model, if anyjava.util.Map<Property<?>,java.lang.Object>
getRawAttributes()
boolean
isAlarmingSupported()
boolean
isEnabled()
Returns the enabled bit for this tagstatic void
main(java.lang.String[] agrs)
Tag
removeChild(java.lang.String name)
void
setAccessRights(AccessRightsType accessRights)
Sets the type of access rights for this tag.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 permissionModel)
void
setRawAttributes(java.util.Map<Property<?>,java.lang.Object> value)
void
setValue(TagValue tv)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.sqltags.model.MutableTag
setAlarmStates
-
Methods inherited from interface com.inductiveautomation.ignition.common.sqltags.model.Tag
getAlarmStates, getType
-
-
-
-
Field Detail
-
attributes
protected java.util.Map<Property<?>,java.lang.Object> attributes
-
type
protected DataType type
-
accessRights
protected AccessRightsType accessRights
-
permissionModel
protected TagPermissionsModel permissionModel
-
eventScripts
protected TagEventScripts eventScripts
-
enabled
protected boolean enabled
-
name
protected java.lang.String name
-
-
Method Detail
-
getChild
public Tag getChild(java.lang.String name)
-
removeChild
public Tag removeChild(java.lang.String name)
-
getName
public java.lang.String getName()
Description copied from interface:Tag
Returns the name of the tag.
-
setName
public void setName(java.lang.String name)
Description copied from interface:MutableTag
Sets the name of this tag- Specified by:
setName
in interfaceMutableTag
-
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
-
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
-
coerceValue
protected QualifiedValue coerceValue(QualifiedValue value) throws java.lang.ClassCastException
Coerces the value inside the argument QualifiedValue to this tag's datatype, if that value is not null.- Throws:
java.lang.ClassCastException
-
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
-
setEnabled
public void setEnabled(boolean en)
Description copied from interface:MutableTag
Sets this tag enabled/disabled- Specified by:
setEnabled
in interfaceMutableTag
-
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
-
getChildren
public java.util.List<? extends Tag> getChildren()
-
addChild
public void addChild(Tag child)
-
getAttribute
public QualifiedValue getAttribute(Property<?> prop)
Description copied from interface:Tag
Gets the value of the given tag attribute.- Specified by:
getAttribute
in interfaceTag
-
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
-
getRawAttributes
public java.util.Map<Property<?>,java.lang.Object> getRawAttributes()
-
setRawAttributes
public void setRawAttributes(java.util.Map<Property<?>,java.lang.Object> value)
-
getAccessRights
public AccessRightsType getAccessRights()
Description copied from interface:Tag
Gets the type of access rights for this tag- Specified by:
getAccessRights
in interfaceTag
-
setAccessRights
public void setAccessRights(AccessRightsType accessRights)
Description copied from interface:MutableTag
Sets the type of access rights for this tag.- Specified by:
setAccessRights
in interfaceMutableTag
-
getPermissionModel
public TagPermissionsModel getPermissionModel()
Description copied from interface:Tag
Returns this tags permission model, if any- Specified by:
getPermissionModel
in interfaceTag
-
setPermissionModel
public void setPermissionModel(TagPermissionsModel permissionModel)
-
getEventScripts
public TagEventScripts getEventScripts()
- Specified by:
getEventScripts
in interfaceTag
-
setEventScripts
public void setEventScripts(TagEventScripts scripts)
- Specified by:
setEventScripts
in interfaceMutableTag
-
isAlarmingSupported
public boolean isAlarmingSupported()
-
compareTo
public int compareTo(Tag that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Tag>
-
main
public static void main(java.lang.String[] agrs)
-
-