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
All elements a VarModel could contain.
- Author:
- Marcel Lueder
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModelElement(String name) Constructor for the model element. -
Method Summary
Modifier and TypeMethodDescriptionstatic final AttributefindAttribute(IAttributeAccess access, String name) Searches for a specified attribute.final StringReturns the comment of the model element.final StringgetName()Returns the name of the model element.Returns the namespace introduced by this model element.Returns the parent model element.Returns the qualified name of this element.final StringReturns the UniqueName of this model element.booleanReturns 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(String comment) Changes the (possibly internationalized) comment of this model element.protected voidChanges the name of this model element.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.ssehub.easy.varModel.model.IModelElement
accept
-
Field Details
-
name
-
comment
-
isUnique
private boolean isUnique
-
-
Constructor Details
-
ModelElement
Constructor for the model element.- Parameters:
name- Name of the model element
-
-
Method Details
-
getName
Description copied from interface:IModelElementReturns the name of the model element.- Specified by:
getNamein interfaceIModelElement- Returns:
- Name of this model element.
-
toString
-
getComment
Description copied from interface:IModelElementReturns the comment of the model element.- Specified by:
getCommentin interfaceIModelElement- Returns:
- Comment of this model element.
- See Also:
-
setComment
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
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
Description copied from interface:IModelElementReturns the qualified name of this element.- Specified by:
getQualifiedNamein interfaceIModelElement- Returns:
- the qualified name
-
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
Changes the name of this model element.- Parameters:
name- the new name
-
findAttribute
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
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
Description copied from interface:IModelElementReturns the parent model element.- Specified by:
getParentin interfaceIModelElement- Returns:
- the parent model element (may be null)
-