Class 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 Details

    • Comment

      Comment()
      Constructor for serialization.
    • Comment

      public Comment(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 Details

    • accept

      public void accept(IModelVisitor visitor)
      Description copied from interface: IModelElement
      Accept method for the visitor.
      Parameters:
      visitor - The visitor, which should process this model element.
    • getComment

      public Comment getComment(Object element)
      Returns the comment assigned to the given model element.
      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(Object element, Comment comment)
      Assigns a comment to the given model element. This method is not implemented.
      Parameters:
      element - the element to assign the comment to
      comment - the comment to assign the element to
    • getNameSpace

      public String getNameSpace()
      Description copied from interface: IModelElement
      Returns the namespace introduced by this model element.
      Specified by:
      getNameSpace in interface IModelElement
      Overrides:
      getNameSpace in class ContainableModelElement
      Returns:
      the namespace introduced by this model element.
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: IModelElement
      Returns the qualified name of this element.
      Specified by:
      getQualifiedName in interface IModelElement
      Overrides:
      getQualifiedName in class ContainableModelElement
      Returns:
      the qualified name