Package net.ssehub.easy.varModel.model
Class Comment
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.Comment
-
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement
- Direct Known Subclasses:
StructuredComment
public class Comment extends ContainableModelElement
Represents a comment in the source of an IVML file. Instances of this model element are required to properly restore the input IVML file (after modifications) by using output iterators. Each comment consists of its text (may be multiple successive comments and whitespaces without outer model element in between) and a position which indicates where in the following model element to attach this comment to (supported constant definitions are given in this class).
Please note: Currently we realize a simplified model for the comments, i.e. only comments which describe language constructs but not inlined comments within individual language constructs are implemented by this class and by specialized subclasses.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description Comment()Constructor for serialization.Comment(java.lang.String comment, IModelElement parent)Creates a new comment element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IModelVisitor visitor)Accept method for the visitor.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.java.lang.StringgetNameSpace()Returns the namespace introduced by this model element.java.lang.StringgetQualifiedName()Returns the qualified name of this element.-
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
-
-
-
-
Constructor Detail
-
Comment
Comment()
Constructor for serialization.
-
Comment
public Comment(java.lang.String comment, IModelElement parent)Creates a new 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
-
accept
public void accept(IModelVisitor visitor)
Description copied from interface:IModelElementAccept method for the visitor.- Parameters:
visitor- The visitor, which should process this model element.
-
getComment
public Comment getComment(java.lang.Object element)
Returns the comment assigned to the given modelelement.- Parameters:
element- the element to return the comment for- Returns:
- the assigned comment (or null if none is assigned), null by default
-
assignComment
public void assignComment(java.lang.Object element, Comment comment)Assigns acommentto the given modelelement. This method is not implemented.- Parameters:
element- the element to assign the comment tocomment- the comment to assign the element to
-
getNameSpace
public java.lang.String getNameSpace()
Description copied from interface:IModelElementReturns the namespace introduced by this model element.- Specified by:
getNameSpacein interfaceIModelElement- Overrides:
getNameSpacein classContainableModelElement- 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 classContainableModelElement- Returns:
- the qualified name
-
-