Package com.github.javaparser
Class CommentsInserter
- java.lang.Object
-
- com.github.javaparser.CommentsInserter
-
class CommentsInserter extends java.lang.Object
Assigns comments to nodes of the AST.
-
-
Field Summary
Fields Modifier and Type Field Description private ParserConfiguration
configuration
-
Constructor Summary
Constructors Constructor Description CommentsInserter(ParserConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
attributeLineCommentsOnSameLine(java.util.TreeSet<Comment> commentsToAttribute, java.util.List<Node> children)
private boolean
attributeLineCommentToNodeOrChild(Node node, LineComment lineComment)
private boolean
commentIsOnNextLine(Node a, Comment c)
private void
insertComments(CompilationUnit cu, java.util.TreeSet<Comment> comments)
Comments are attributed to the thing they comment and are removed from the comments.(package private) void
insertComments(Node node, java.util.TreeSet<Comment> commentsToAttribute)
This method try to attributes the nodes received to child of the node.private boolean
thereAreLinesBetween(Node a, Node b)
-
-
-
Field Detail
-
configuration
private final ParserConfiguration configuration
-
-
Constructor Detail
-
CommentsInserter
CommentsInserter(ParserConfiguration configuration)
-
-
Method Detail
-
insertComments
private void insertComments(CompilationUnit cu, java.util.TreeSet<Comment> comments)
Comments are attributed to the thing they comment and are removed from the comments.
-
insertComments
void insertComments(Node node, java.util.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(java.util.TreeSet<Comment> commentsToAttribute, java.util.List<Node> children)
-
attributeLineCommentToNodeOrChild
private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment)
-
-