Class 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
    • 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 model element.
        Overrides:
        getComment in class Comment
        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 a comment to the given model element.
        Overrides:
        assignComment in class Comment
        Parameters:
        element - the element to assign the comment to
        comment - the comment to assign the element to