use of com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocNodeImpl in project checkstyle by checkstyle.
the class JavadocDetailNodeParser method insertChildrenNodes.
/**
* Creates child nodes for each node from 'nodes' array.
* @param parseTreeParent original ParseTree parent node
* @param nodes array of JavadocNodeImpl nodes
*/
private void insertChildrenNodes(final JavadocNodeImpl[] nodes, ParseTree parseTreeParent) {
for (int i = 0; i < nodes.length; i++) {
final JavadocNodeImpl currentJavadocNode = nodes[i];
final ParseTree currentParseTreeNodeChild = parseTreeParent.getChild(i);
final JavadocNodeImpl[] subChildren = createChildrenNodes(currentJavadocNode, currentParseTreeNodeChild);
currentJavadocNode.setChildren((DetailNode[]) subChildren);
}
}
use of com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocNodeImpl in project checkstyle by checkstyle.
the class JavadocDetailNodeParser method createJavadocNode.
/**
* Creates JavadocNodeImpl node on base of ParseTree node.
*
* @param parseTree ParseTree node
* @param parent DetailNode that will be parent of new node
* @param index child index that has new node
* @return JavadocNodeImpl node on base of ParseTree node.
*/
private JavadocNodeImpl createJavadocNode(ParseTree parseTree, DetailNode parent, int index) {
final JavadocNodeImpl node = new JavadocNodeImpl();
node.setText(parseTree.getText());
node.setColumnNumber(getColumn(parseTree));
node.setLineNumber(getLine(parseTree) + blockCommentLineNumber);
node.setIndex(index);
node.setType(getTokenType(parseTree));
node.setParent(parent);
node.setChildren((DetailNode[]) new JavadocNodeImpl[parseTree.getChildCount()]);
return node;
}
Aggregations