Package net.ssehub.easy.varModel.model
Class ContainableModelElement
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement
- Direct Known Subclasses:
AbstractVariable,AttributeAssignment,Comment,CompoundAccessStatement,Constraint,CustomDatatype,EvaluationBlock,OperationDefinition,ProjectInterface
public abstract class ContainableModelElement extends ModelElement implements IDatatypeVisitable
Represents the objects, a project can handle.- Author:
- Marcel Lueder, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IModelElementparent
-
Constructor Summary
Constructors Modifier Constructor Description protectedContainableModelElement(java.lang.String name, IModelElement parent)Constructor for containable model element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IDatatypeVisitor visitor)Accepts a specialized visitor for creating a textual representation of the identity of this type.java.lang.StringgetNameSpace()Returns the namespace introduced by this model element.IModelElementgetParent()Returns the parent model element.ProjectgetProject()Returns the containing project.java.lang.StringgetQualifiedName()Returns the qualified name of this element.IModelElementgetTopLevelParent()Returns the topLevel parent.booleanisTopLevel()Method to check whether the parent is a topLevel-element.voidsetParent(IModelElement parent)Changes the parent object.-
Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toString
-
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
-
-
-
-
Field Detail
-
parent
private IModelElement parent
-
-
Constructor Detail
-
ContainableModelElement
protected ContainableModelElement(java.lang.String name, IModelElement parent)Constructor for containable model element.- Parameters:
name- Name of the containable model elementparent- the object, in which this specific one is embedded
-
-
Method Detail
-
getParent
public final IModelElement getParent()
Description copied from interface:IModelElementReturns the parent model element.- Specified by:
getParentin interfaceIModelElement- Overrides:
getParentin classModelElement- Returns:
- the parent model element (may be null)
-
getTopLevelParent
public final IModelElement getTopLevelParent()
Returns the topLevel parent.- Returns:
- should be the project
-
getProject
public final Project getProject()
Returns the containing project.- Returns:
- the contaning project (may be null if there is none)
-
isTopLevel
public final boolean isTopLevel()
Method to check whether the parent is a topLevel-element.- Returns:
- true, if the parent is the project, otherwise false
-
getNameSpace
public java.lang.String getNameSpace()
Description copied from interface:IModelElementReturns the namespace introduced by this model element.- Specified by:
getNameSpacein interfaceIModelElement- Overrides:
getNameSpacein classModelElement- 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- Overrides:
getQualifiedNamein classModelElement- Returns:
- the qualified name
-
setParent
public final void setParent(IModelElement parent)
Changes the parent object. Note, that this operation is necessary (although not intended) to resolve some of the cycles in creating compounds or temporary variables.- Parameters:
parent- the parent element
-
accept
public void accept(IDatatypeVisitor visitor)
Description copied from interface:IDatatypeVisitableAccepts a specialized visitor for creating a textual representation of the identity of this type.- Specified by:
acceptin interfaceIDatatypeVisitable- Parameters:
visitor- the visitor to accept
-
-