Class ComplexTagDefinition

All Implemented Interfaces:
Countable, Extendable<PropertySet>, Mergable<PropertySet>, MutablePropertyValueSource, ObservablePropertySet, PropertySet, PropertyValueSource, MutableTag, Tag, TagNode, ComplexTag, MutableComplexTag, Serializable, Comparable<Tag>, 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:
  • Constructor Details

    • ComplexTagDefinition

      public ComplexTagDefinition()
    • ComplexTagDefinition

      public ComplexTagDefinition(TagPath typePath, Tag source)
    • 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(String name, TagType type)
      New type instance. Used for creating new types or instances.
  • Method Details

    • 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 interface ComplexTag
    • getParentType

      public TagPath getParentType()
    • getMembers

      public 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 interface ComplexTag
    • getLocalMembers

      public Collection<Member> getLocalMembers(boolean opaque)
    • getMembers

      protected Collection<Member> getMembers(boolean localOnly, boolean opaque)
    • getMember

      public Member getMember(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 interface ComplexTag
    • 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 interface ComplexTag
    • getOverrides

      public PropertySet getOverrides(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 interface ComplexTag
    • addMember

      public List<Member> addMember(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 interface MutableComplexTag
      Parameters:
      parentUid - the UID of the parent to receive the new child member
      member - the child to add
    • addMember

      public List<Member> addMember(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(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, 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.
    • addMembers

      public void addMembers(TagPath basePath, Collection<Member> members)
    • addMember

      protected void addMember(Member member)
    • removeMember

      public void removeMember(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 interface MutableComplexTag
      Parameters:
      memberUid - the uid of the member to remove from the complex tag
    • isMemberInherited

      protected boolean isMemberInherited(Member m)
    • getTypePathFor

      public static TagPath getTypePathFor(Tag tag)
    • createTypeFrom

      public static ComplexTagDefinition createTypeFrom(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.
    • addTagMembersDeep

      protected void addTagMembersDeep(TagNode node, String parentId, TagPath curPath)