Class Comment

    • Constructor Detail

      • Comment

        public Comment​(String content)
      • Comment

        @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
        public Comment​(TokenRange tokenRange,
                       String content)
        This constructor is used by the parser and is considered private.
    • Method Detail

      • getContent

        @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
        public String getContent()
        Return the text of the comment.
        Returns:
        text of the comment
      • setContent

        @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
        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

        @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator")
        public boolean remove​(Node node)
        Overrides:
        remove in class Node
      • clone

        @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
        public Comment clone()
        Overrides:
        clone in class Node
      • getMetaModel

        @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
        public CommentMetaModel getMetaModel()
        Overrides:
        getMetaModel in class Node
        Returns:
        get JavaParser specific node introspection information.
      • replace

        @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator")
        public boolean replace​(Node node,
                               Node replacementNode)
        Overrides:
        replace in class Node