Package net.ssehub.easy.varModel.model
Class StructuredComment
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.Comment
-
- net.ssehub.easy.varModel.model.StructuredComment
-
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement
public class StructuredComment extends Comment
Defines a structured comment which stores relations between nested model elements of the following model element and the comments stored in this comment. The comments assigned to the following model element shall therefore be stored in a structured comment.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description StructuredComment()Constructor for serialization.StructuredComment(java.lang.String comment, IModelElement parent)Creates a new structured comment element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignComment(java.lang.Object element, Comment comment)Assigns acommentto the given modelelement.CommentgetComment(java.lang.Object element)Returns the comment assigned to the given modelelement.-
Methods inherited from class net.ssehub.easy.varModel.model.Comment
accept, getNameSpace, getQualifiedName
-
Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
accept, getParent, getProject, getTopLevelParent, isTopLevel, setParent
-
Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toString
-
-
-
-
Field Detail
-
comments
private java.util.Map<java.lang.Object,Comment> comments
Stores the sub comments.
-
-
Constructor Detail
-
StructuredComment
StructuredComment()
Constructor for serialization.
-
StructuredComment
public StructuredComment(java.lang.String comment, IModelElement parent)Creates a new structured comment element.- Parameters:
comment- the comment (to be stored as the "name" of this model element)parent- the model element, in which this specific one is embedded
-
-
Method Detail
-
getComment
public Comment getComment(java.lang.Object element)
Returns the comment assigned to the given modelelement.- Overrides:
getCommentin classComment- Parameters:
element- the element to return the comment for- Returns:
- the assigned comment (or null if none is assigned)
-
assignComment
public void assignComment(java.lang.Object element, Comment comment)Assigns acommentto the given modelelement.- Overrides:
assignCommentin classComment- Parameters:
element- the element to assign the comment tocomment- the comment to assign the element to
-
-