Top Description Fields Constructors Methods
com.github.javaparser

pack-priv Class CommentsInserter

extends Object
Class Inheritance
Imports
com.github.javaparser.ast.CompilationUnit, .Modifier, .Node, com.github.javaparser.ast.comments.Comment, .LineComment, com.github.javaparser.utils.PositionUtils, java.util.Collections, .LinkedList, .List, .TreeSet

Assigns comments to nodes of the AST.
Authors
Sebastian Kuerten, Júlio Vilmar Gesser

Field Summary

Modifier and TypeField and Description
private final ParserConfiguration

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
attributeLineCommentsOnSameLine(TreeSet<Comment> commentsToAttribute, List<Node> children)

private boolean
private void
insertComments(CompilationUnit cu, TreeSet<Comment> comments)

Comments are attributed to the thing they comment and are removed from the comments.

pack-priv void
insertComments(Node node, TreeSet<Comment> commentsToAttribute)

This method try to attributes the nodes received to child of the node.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
private final ParserConfiguration configuration

Constructor Detail

CommentsInserterback to summary
pack-priv CommentsInserter(ParserConfiguration configuration)

Method Detail

attributeLineCommentsOnSameLineback to summary
private void attributeLineCommentsOnSameLine(TreeSet<Comment> commentsToAttribute, List<Node> children)
attributeLineCommentToNodeOrChildback to summary
private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment)
insertCommentsback to summary
private void insertComments(CompilationUnit cu, TreeSet<Comment> comments)

Comments are attributed to the thing they comment and are removed from the comments.

insertCommentsback to summary
pack-priv 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.

thereAreLinesBetweenback to summary
private boolean thereAreLinesBetween(Node a, Node b)