Package net.ssehub.easy.varModel.model
Class ModelElement
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- All Implemented Interfaces:
IModelElement
- Direct Known Subclasses:
BasicDecisionVariableContainer,ContainableModelElement,EnumLiteral,Project
public abstract class ModelElement extends java.lang.Object implements IModelElement
All elements a VarModel could contain.- Author:
- Marcel Lueder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedModelElement(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 AttributefindAttribute(IAttributeAccess access, java.lang.String name)Searches for a specified attribute.java.lang.StringgetComment()Returns the comment of the model element.java.lang.StringgetName()Returns the name of the model element.java.lang.StringgetNameSpace()Returns the namespace introduced by this model element.IModelElementgetParent()Returns the parent model element.java.lang.StringgetQualifiedName()Returns the qualified name of this element.java.lang.StringgetUniqueName()Returns the UniqueName of this model element.booleanisTransparent()Returns whether this element is transparent regarding the naming hierarchy.booleanpropagateAttribute(Attribute attribute)Propagates an attribute application from the parent to this element or contained elements.voidsetComment(java.lang.String comment)Changes the (possibly internationalized) comment of this model element.protected voidsetName(java.lang.String name)Changes the name of this model element.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.varModel.model.IModelElement
accept
-
-
-
-
Method Detail
-
getName
public final java.lang.String getName()
Description copied from interface:IModelElementReturns the name of the model element.- Specified by:
getNamein interfaceIModelElement- Returns:
- Name of this model element.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getComment
public final java.lang.String getComment()
Description copied from interface:IModelElementReturns the comment of the model element.- Specified by:
getCommentin interfaceIModelElement- Returns:
- Comment of this model element.
- See Also:
IModelElement.setComment(String)
-
setComment
public void setComment(java.lang.String comment)
Description copied from interface:IModelElementChanges 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:
setCommentin interfaceIModelElement- Parameters:
comment- the new comment, turned into an empty string ifnull
-
getNameSpace
public java.lang.String getNameSpace()
Description copied from interface:IModelElementReturns the namespace introduced by this model element.- Specified by:
getNameSpacein interfaceIModelElement- Returns:
- the namespace introduced by this model element.
-
getQualifiedName
public java.lang.String getQualifiedName()
Description copied from interface:IModelElementReturns the qualified name of this element.- Specified by:
getQualifiedNamein interfaceIModelElement- Returns:
- the qualified name
-
getUniqueName
public final java.lang.String getUniqueName()
Description copied from interface:IModelElementReturns the UniqueName of this model element.- Specified by:
getUniqueNamein interfaceIModelElement- 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 attributesname- 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:IModelElementPropagates an attribute application from the parent to this element or contained elements. This may imply the creation of clones of the givenattribute.- Specified by:
propagateAttributein interfaceIModelElement- Parameters:
attribute- the attribute to be propagated- Returns:
trueif the operation was successful,falseif the element is about being attributed multiple times with the same attribute
-
isTransparent
public boolean isTransparent()
Description copied from interface:IModelElementReturns whether this element is transparent regarding the naming hierarchy.- Specified by:
isTransparentin interfaceIModelElement- Returns:
trueif it is transparent,falseelse
-
getParent
public IModelElement getParent()
Description copied from interface:IModelElementReturns the parent model element.- Specified by:
getParentin interfaceIModelElement- Returns:
- the parent model element (may be null)
-
-