Class ModelElement

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String comment  
      private boolean isUnique  
      private java.lang.String name  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ModelElement​(java.lang.String name)
      Constructor for the model element.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Attribute findAttribute​(IAttributeAccess access, java.lang.String name)
      Searches for a specified attribute.
      java.lang.String getComment()
      Returns the comment of the model element.
      java.lang.String getName()
      Returns the name of the model element.
      java.lang.String getNameSpace()
      Returns the namespace introduced by this model element.
      IModelElement getParent()
      Returns the parent model element.
      java.lang.String getQualifiedName()
      Returns the qualified name of this element.
      java.lang.String getUniqueName()
      Returns the UniqueName of this model element.
      boolean isTransparent()
      Returns whether this element is transparent regarding the naming hierarchy.
      boolean propagateAttribute​(Attribute attribute)
      Propagates an attribute application from the parent to this element or contained elements.
      void setComment​(java.lang.String comment)
      Changes the (possibly internationalized) comment of this model element.
      protected void setName​(java.lang.String name)
      Changes the name of this model element.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
      • comment

        private java.lang.String comment
      • isUnique

        private boolean isUnique
    • Constructor Detail

      • ModelElement

        protected ModelElement​(java.lang.String name)
        Constructor for the model element.
        Parameters:
        name - Name of the model element
    • Method Detail

      • getName

        public final java.lang.String getName()
        Description copied from interface: IModelElement
        Returns the name of the model element.
        Specified by:
        getName in interface IModelElement
        Returns:
        Name of this model element.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setComment

        public void setComment​(java.lang.String comment)
        Description copied from interface: IModelElement
        Changes the (possibly internationalized) comment of this model element. Please note that comments are not stored in the model rather than in additional resource files associated to the model. Use #storeComments(de.uni_hildesheim.sse.model.management.ProjectInfo) for storing comments. Loading of comments is done as part of loading models.
        Specified by:
        setComment in interface IModelElement
        Parameters:
        comment - the new comment, turned into an empty string if null
      • getNameSpace

        public java.lang.String getNameSpace()
        Description copied from interface: IModelElement
        Returns the namespace introduced by this model element.
        Specified by:
        getNameSpace in interface IModelElement
        Returns:
        the namespace introduced by this model element.
      • getQualifiedName

        public java.lang.String getQualifiedName()
        Description copied from interface: IModelElement
        Returns the qualified name of this element.
        Specified by:
        getQualifiedName in interface IModelElement
        Returns:
        the qualified name
      • getUniqueName

        public final java.lang.String getUniqueName()
        Description copied from interface: IModelElement
        Returns the UniqueName of this model element.
        Specified by:
        getUniqueName in interface IModelElement
        Returns:
        the unique name of this model element
      • setName

        protected void setName​(java.lang.String name)
        Changes the name of this model element.
        Parameters:
        name - the new name
      • findAttribute

        public static final Attribute findAttribute​(IAttributeAccess access,
                                                    java.lang.String name)
        Searches for a specified attribute.
        Parameters:
        access - the instance providing access to attributes
        name - the name of the attribute to search for
        Returns:
        the attribute or null if not found
      • propagateAttribute

        public boolean propagateAttribute​(Attribute attribute)
        Description copied from interface: IModelElement
        Propagates an attribute application from the parent to this element or contained elements. This may imply the creation of clones of the given attribute.
        Specified by:
        propagateAttribute in interface IModelElement
        Parameters:
        attribute - the attribute to be propagated
        Returns:
        true if the operation was successful, false if the element is about being attributed multiple times with the same attribute
      • isTransparent

        public boolean isTransparent()
        Description copied from interface: IModelElement
        Returns whether this element is transparent regarding the naming hierarchy.
        Specified by:
        isTransparent in interface IModelElement
        Returns:
        true if it is transparent, false else