Class Comment

    • Constructor Detail

      • Comment

        public Comment​(String content)
      • Comment

        public Comment​(TokenRange tokenRange,
                       String content)
        This constructor is used by the parser and is considered private.
    • Method Detail

      • getContent

        public String getContent()
        Return the text of the comment.
        Returns:
        text of the comment
      • setContent

        public Comment setContent​(String content)
        Sets the text of the comment.
        Parameters:
        content - the text of the comment to set
      • isLineComment

        public boolean isLineComment()
      • getCommentedNode

        public Optional<Node> getCommentedNode()
      • setCommentedNode

        public Comment setCommentedNode​(Node commentedNode)
        Sets the commentedNode
        Parameters:
        commentedNode - the commentedNode, can be null
        Returns:
        this, the Comment
      • isOrphan

        public boolean isOrphan()
      • remove

        public boolean remove()
        Description copied from class: Node
        Try to remove this node from the parent
        Overrides:
        remove in class Node
        Returns:
        true if removed, false if it is a required property of the parent, or if the parent isn't set.
      • remove

        public boolean remove​(Node node)
        Overrides:
        remove in class Node
      • getMetaModel

        public CommentMetaModel getMetaModel()
        Overrides:
        getMetaModel in class Node
        Returns:
        get JavaParser specific node introspection information.
      • replace

        public boolean replace​(Node node,
                               Node replacementNode)
        Overrides:
        replace in class Node
      • isBlockComment

        public boolean isBlockComment()
      • isJavadocComment

        public boolean isJavadocComment()