JavadocDetailNodeParser.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:checkstyle-backport-jre6 作者:
/**
 * 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();
    if (parseTree.getChildCount() == 0
            || "Text".equals(getNodeClassNameWithoutContext(parseTree))) {
        node.setText(parseTree.getText());
    }
    else {
        node.setText(getFormattedNodeClassNameWithoutContext(parseTree));
    }
    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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号