Class CommentsInserter

java.lang.Object
com.github.javaparser.CommentsInserter

class CommentsInserter extends Object
Assigns comments to nodes of the AST.
  • Field Details

  • Constructor Details

  • Method Details

    • insertComments

      private void insertComments(CompilationUnit cu, TreeSet<Comment> comments)
      Comments are attributed to the thing they comment and are removed from the comments.
    • insertComments

      void insertComments(Node node, TreeSet<Comment> commentsToAttribute)
      This method try to attributes the nodes received to child of the node. It returns the node that were not attributed.
    • attributeLineCommentsOnSameLine

      private void attributeLineCommentsOnSameLine(TreeSet<Comment> commentsToAttribute, List<Node> children)
    • attributeLineCommentToNodeOrChild

      private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment)
    • thereAreLinesBetween

      private boolean thereAreLinesBetween(Node a, Node b)
    • commentIsOnNextLine

      private boolean commentIsOnNextLine(Node a, Comment c)