Class Comment

    • Field Detail

      • content

        private java.lang.String content
      • commentedNode

        private Node commentedNode
    • Constructor Detail

      • Comment

        public Comment​(java.lang.String content)
      • Comment

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

      • getContent

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

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

        public boolean isLineComment()
      • getCommentedNode

        public java.util.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()
      • setComment

        public Node setComment​(Comment comment)
        Description copied from class: Node
        Use this to store additional information to this node.
        Overrides:
        setComment in class Node
        Parameters:
        comment - to be set
      • 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.
      • findRootNode

        public Node findRootNode()
        Description copied from class: Node
        Finds the root node of this AST by finding the topmost parent.
        Overrides:
        findRootNode in class Node
      • getMetaModel

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

        public boolean isBlockComment()
      • isJavadocComment

        public boolean isJavadocComment()
      • ifBlockComment

        public void ifBlockComment​(java.util.function.Consumer<BlockComment> action)
      • ifJavadocComment

        public void ifJavadocComment​(java.util.function.Consumer<JavadocComment> action)
      • ifLineComment

        public void ifLineComment​(java.util.function.Consumer<LineComment> action)
      • toBlockComment

        public java.util.Optional<BlockComment> toBlockComment()
      • toJavadocComment

        public java.util.Optional<JavadocComment> toJavadocComment()
      • toLineComment

        public java.util.Optional<LineComment> toLineComment()
      • getHeader

        public abstract java.lang.String getHeader()
      • getFooter

        public abstract java.lang.String getFooter()
      • asString

        public java.lang.String asString()