当前位置: 首页>>代码示例>>Java>>正文


Java JavadocTokenTypes.JAVADOC属性代码示例

本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes.JAVADOC属性的典型用法代码示例。如果您正苦于以下问题:Java JavadocTokenTypes.JAVADOC属性的具体用法?Java JavadocTokenTypes.JAVADOC怎么用?Java JavadocTokenTypes.JAVADOC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes的用法示例。


在下文中一共展示了JavadocTokenTypes.JAVADOC属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printTree

/**
 * Print AST.
 * @param ast the root AST node.
 * @param rootPrefix prefix for the root node
 * @param prefix prefix for other nodes
 * @return string AST.
 */
public static String printTree(DetailNode ast, String rootPrefix, String prefix) {
    final StringBuilder messageBuilder = new StringBuilder(1024);
    DetailNode node = ast;
    while (node != null) {
        if (node.getType() == JavadocTokenTypes.JAVADOC) {
            messageBuilder.append(rootPrefix);
        }
        else {
            messageBuilder.append(prefix);
        }
        messageBuilder.append(getIndentation(node))
                .append(JavadocUtils.getTokenName(node.getType())).append(" -> ")
                .append(JavadocUtils.escapeAllControlChars(node.getText())).append(" [")
                .append(node.getLineNumber()).append(':').append(node.getColumnNumber())
                .append(']').append(LINE_SEPARATOR)
                .append(printTree(JavadocUtils.getFirstChild(node), rootPrefix, prefix));
        node = JavadocUtils.getNextSibling(node);
    }
    return messageBuilder.toString();
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:27,代码来源:DetailNodeTreeStringPrinter.java

示例2: isEmptyLine

/**
 * Determines whether or not the line is empty line.
 * @param newLine NEWLINE node.
 * @return true, if line is empty line.
 */
private static boolean isEmptyLine(DetailNode newLine) {
    boolean result = false;
    DetailNode previousSibling = JavadocUtils.getPreviousSibling(newLine);
    if (previousSibling != null
            && previousSibling.getParent().getType() == JavadocTokenTypes.JAVADOC) {
        if (previousSibling.getType() == JavadocTokenTypes.TEXT
                && CommonUtils.isBlank(previousSibling.getText())) {
            previousSibling = JavadocUtils.getPreviousSibling(previousSibling);
        }
        result = previousSibling != null
                && previousSibling.getType() == JavadocTokenTypes.LEADING_ASTERISK;
    }
    return result;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:19,代码来源:JavadocParagraphCheck.java

示例3: testTokens

@Test
public void testTokens() {
    final int[] defaultJavadocTokens = {JavadocTokenTypes.JAVADOC};
    final AbstractJavadocCheck check = new AbstractJavadocCheck() {

        @Override
        public void visitJavadocToken(DetailNode ast) {
            // no code necessary
        }

        @Override
        public int[] getDefaultJavadocTokens() {
            return defaultJavadocTokens;
        }
    };

    Assert.assertNotNull("Default tokens should not be null", check.getDefaultTokens());
    Assert.assertArrayEquals("Acceptable tokens should be equal to default",
            check.getDefaultTokens(), check.getAcceptableTokens());
    Assert.assertArrayEquals("Required tokens should be equal to default",
            check.getDefaultTokens(), check.getRequiredTokens());
    Assert.assertArrayEquals("Invalid default javadoc tokens",
            defaultJavadocTokens, check.getDefaultJavadocTokens());
    Assert.assertArrayEquals("Invalid acceptable javadoc tokens",
            defaultJavadocTokens, check.getAcceptableJavadocTokens());
    Assert.assertNotEquals("Invalid required javadoc tokens",
            defaultJavadocTokens, check.getRequiredJavadocTokens());
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:28,代码来源:AbstractJavadocCheckTest.java

示例4: testTokens

@Test
public void testTokens() {
    final int[] defaultJavadocTokens = {JavadocTokenTypes.JAVADOC};
    final AbstractJavadocCheck check = new AbstractJavadocCheck() {
        @Override
        public void visitJavadocToken(DetailNode ast) {
            // no code necessary
        }

        @Override
        public int[] getDefaultJavadocTokens() {
            return defaultJavadocTokens;
        }
    };

    Assert.assertNotNull("Default tokens should not be null", check.getDefaultTokens());
    Assert.assertArrayEquals("Acceptable tokens should be equal to default",
            check.getDefaultTokens(), check.getAcceptableTokens());
    Assert.assertArrayEquals("Required tokens should be equal to default",
            check.getDefaultTokens(), check.getRequiredTokens());
    Assert.assertArrayEquals("Invalid default javadoc tokens",
            defaultJavadocTokens, check.getDefaultJavadocTokens());
    Assert.assertArrayEquals("Invalid acceptable javadoc tokens",
            defaultJavadocTokens, check.getAcceptableJavadocTokens());
    Assert.assertNotEquals("Invalid required javadoc tokens",
            defaultJavadocTokens, check.getRequiredJavadocTokens());
}
 
开发者ID:checkstyle,项目名称:checkstyle,代码行数:27,代码来源:AbstractJavadocCheckTest.java

示例5: getDefaultJavadocTokens

@Override
public int[] getDefaultJavadocTokens() {
    return new int[] {
        JavadocTokenTypes.JAVADOC,
    };
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:6,代码来源:SummaryJavadocCheck.java

示例6: getDefaultJavadocTokens

@Override
public int[] getDefaultJavadocTokens() {
    return new int[] {JavadocTokenTypes.JAVADOC};
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:4,代码来源:AbstractJavadocCheckTest.java


注:本文中的com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes.JAVADOC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。