Class ComplexTagDefinition
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicPropertySet
-
- com.inductiveautomation.ignition.common.sqltags.TagDefinition
-
- com.inductiveautomation.ignition.common.sqltags.udt.ComplexTagDefinition
-
- All Implemented Interfaces:
Countable
,Extendable<PropertySet>
,Mergable<PropertySet>
,MutablePropertyValueSource
,ObservablePropertySet
,PropertySet
,PropertyValueSource
,MutableTag
,Tag
,TagNode
,ComplexTag
,MutableComplexTag
,java.io.Serializable
,java.lang.Comparable<Tag>
,java.lang.Iterable<PropertyValue>
public class ComplexTagDefinition extends TagDefinition implements MutableComplexTag
The ComplexTagDefinition is the primary implementation of ComplexTag. It can be used to create fully built opaque representations of a UDT, or it can be used for just the local definition of the type or instance. In other words, this definition may be a partial definition of the overall type.- 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 ComplexTagDefinition()
ComplexTagDefinition(Tag source)
ComplexTagDefinition(TagPath typePath, Tag source)
ComplexTagDefinition(Tag source, boolean copyMembers)
ComplexTagDefinition(Tag source, boolean copyMembers, boolean localMembersOnly)
ComplexTagDefinition(Tag instanceDef, ComplexTag parentType)
This is the constructor for a complex instance.ComplexTagDefinition(java.lang.String name, TagType type)
New type instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCompositeMember(Member definingMember, java.util.Collection<Member> opaqueSubMembers)
Adds the member, along with the sub members (which can be null, for simple types).protected void
addMember(Member member)
java.util.List<Member>
addMember(java.lang.String parentUid, Tag member)
Adds the given tag as a member under the provided parent folder uid.java.util.List<Member>
addMember(java.lang.String parentUid, TagPath fullPath, Tag member)
Adds the given tag under the provided folder id, but with the specified full path.void
addMembers(TagPath basePath, java.util.Collection<Member> members)
protected void
addMembers(java.util.Collection<Member> members, boolean localOnly)
Adds the members to this definition.protected void
addTagMembersDeep(TagNode node, java.lang.String parentId, TagPath curPath)
static ComplexTagDefinition
createTypeFrom(java.util.List<? extends TagNode> tags)
Creates a new data type definition from the provided tag nodes.TagPath
getFullyQualifiedType()
Returns the type id of this tag.java.util.Collection<Member>
getLocalMembers(boolean opaque)
Member
getMember(java.lang.String memberUid)
Returns the member of this complex tag with the given UID, or null if the member doesn't exist.java.util.Collection<Member>
getMembers(boolean opaque)
If opaque, member config objects will already have overrides applied to them.protected java.util.Collection<Member>
getMembers(boolean localOnly, boolean opaque)
PropertySet
getOverrides(java.lang.String memberUid)
Gets the override set for the member.TagPath
getParentType()
static TagPath
getTypePathFor(Tag tag)
protected boolean
isMemberInherited(Member m)
boolean
isTypeDef()
Returns whether this complex type is a type definition, or an instance.void
removeMember(java.lang.String memberUid)
Removes the given member from this complex tag object.-
Methods inherited from class com.inductiveautomation.ignition.common.sqltags.TagDefinition
addChild, addChildren, applyDiff, compareTo, fromNodeDescription, get, getAccessRights, getAlarmStates, getAttribute, getAttributesFrom, getChild, getChildren, getCurrentValue, getDataType, getEventScripts, getExtendedProperties, getName, getOrDefault, getPermissionModel, getPropertyOverrides, getType, isEnabled, isInherited, removeChild, setAccessRights, setAlarmStates, setAlarmStates, setAttribute, setCurrentValue, setDataType, setEnabled, setEventScripts, setName, setPermissionModel, setRawAttributes, setType, setValue
-
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.sqltags.model.udt.MutableComplexTag
setName
-
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
-
Methods inherited from interface com.inductiveautomation.ignition.common.sqltags.model.Tag
getAccessRights, getAlarmStates, getAttribute, getCurrentValue, getDataType, getEventScripts, getName, getPermissionModel, getType, isEnabled
-
-
-
-
Constructor Detail
-
ComplexTagDefinition
public ComplexTagDefinition()
-
ComplexTagDefinition
public ComplexTagDefinition(Tag source)
-
ComplexTagDefinition
public ComplexTagDefinition(Tag source, boolean copyMembers)
-
ComplexTagDefinition
public ComplexTagDefinition(Tag source, boolean copyMembers, boolean localMembersOnly)
-
ComplexTagDefinition
public ComplexTagDefinition(Tag instanceDef, ComplexTag parentType)
This is the constructor for a complex instance. The type stack should have at least one member- the defining type. The instance will inherit all of the members of the type hierarchy. The type of the tag will be assumed from the most recent member of the type stack.
-
ComplexTagDefinition
public ComplexTagDefinition(java.lang.String name, TagType type)
New type instance. Used for creating new types or instances.
-
-
Method Detail
-
getFullyQualifiedType
public TagPath getFullyQualifiedType()
Description copied from interface:ComplexTag
Returns the type id of this tag. If the tag is an instance, will be the type of its parent.- Specified by:
getFullyQualifiedType
in interfaceComplexTag
-
getParentType
public TagPath getParentType()
-
getMembers
public java.util.Collection<Member> getMembers(boolean opaque)
Description copied from interface:ComplexTag
If opaque, member config objects will already have overrides applied to them.- Specified by:
getMembers
in interfaceComplexTag
-
getLocalMembers
public java.util.Collection<Member> getLocalMembers(boolean opaque)
-
getMembers
protected java.util.Collection<Member> getMembers(boolean localOnly, boolean opaque)
-
getMember
public Member getMember(java.lang.String memberUid)
Description copied from interface:ComplexTag
Returns the member of this complex tag with the given UID, or null if the member doesn't exist. However, if the memberUID is null, it returns a member for the root complex tag (a faux member, that is not included in the getMembers() results).- Specified by:
getMember
in interfaceComplexTag
-
isTypeDef
public boolean isTypeDef()
Description copied from interface:ComplexTag
Returns whether this complex type is a type definition, or an instance.- Specified by:
isTypeDef
in interfaceComplexTag
-
getOverrides
public PropertySet getOverrides(java.lang.String memberUid)
Gets the override set for the member. If the member doesn't have overrides defined, creates a new property set.- Specified by:
getOverrides
in interfaceComplexTag
-
addMember
public java.util.List<Member> addMember(java.lang.String parentUid, Tag member)
Adds the given tag as a member under the provided parent folder uid. A member uid will be generated, if one cannot be found using TagProp.UDTMemberUID on the tag.- Specified by:
addMember
in interfaceMutableComplexTag
- Parameters:
parentUid
- the UID of the parent to receive the new child membermember
- the child to add
-
addMember
public java.util.List<Member> addMember(java.lang.String parentUid, TagPath fullPath, Tag member)
Adds the given tag under the provided folder id, but with the specified full path. The full path must be consistent with the parent id. Use the addMember(String, Tag) version of this function to look up the path based on the parent UID.
-
addMembers
protected void addMembers(java.util.Collection<Member> members, boolean localOnly)
Adds the members to this definition. If adjustPath is true, the members will be modified so that their paths extend from this type.
-
addCompositeMember
public void addCompositeMember(Member definingMember, java.util.Collection<Member> opaqueSubMembers)
Adds the member, along with the sub members (which can be null, for simple types). The sub member UIDs will be updated to reflect their new position in the hierarchy.
-
addMember
protected void addMember(Member member)
-
removeMember
public void removeMember(java.lang.String memberUid)
Description copied from interface:MutableComplexTag
Removes the given member from this complex tag object. It's important to note that members can only be removed from the complex tag that defines it- not from sub classes or instances.- Specified by:
removeMember
in interfaceMutableComplexTag
- Parameters:
memberUid
- the uid of the member to remove from the complex tag
-
isMemberInherited
protected boolean isMemberInherited(Member m)
-
createTypeFrom
public static ComplexTagDefinition createTypeFrom(java.util.List<? extends TagNode> tags)
Creates a new data type definition from the provided tag nodes. If only a single folder node is passed in, it's children will be the root of the type.
-
-