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


Java JavadocTokenTypes.LEADING_ASTERISK属性代码示例

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


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

示例1: startsWithInheritDoc

/**
 * Checks if the node starts with an {@inheritDoc}.
 * @param root The root node to examine.
 * @return {@code true} if the javadoc starts with an {@inheritDoc}.
 */
private static boolean startsWithInheritDoc(DetailNode root) {
    boolean found = false;
    final DetailNode[] children = root.getChildren();

    for (int i = 0; !found && i < children.length - 1; i++) {
        final DetailNode child = children[i];
        if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG
                && child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) {
            found = true;
        }
        else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK
                && !CommonUtils.isBlank(child.getText())) {
            break;
        }
    }

    return found;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:23,代码来源:SummaryJavadocCheck.java

示例2: isFirstParagraph

/**
 * Determines whether or not the line with paragraph tag is first line in javadoc.
 * @param paragraphTag paragraph tag.
 * @return true, if line with paragraph tag is first line in javadoc.
 */
private static boolean isFirstParagraph(DetailNode paragraphTag) {
    boolean result = true;
    DetailNode previousNode = JavadocUtils.getPreviousSibling(paragraphTag);
    while (previousNode != null) {
        if (previousNode.getType() == JavadocTokenTypes.TEXT
                && !CommonUtils.isBlank(previousNode.getText())
            || previousNode.getType() != JavadocTokenTypes.LEADING_ASTERISK
                && previousNode.getType() != JavadocTokenTypes.NEWLINE
                && previousNode.getType() != JavadocTokenTypes.TEXT) {
            result = false;
            break;
        }
        previousNode = JavadocUtils.getPreviousSibling(previousNode);
    }
    return result;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:21,代码来源:JavadocParagraphCheck.java

示例3: getNearestNode

/**
 * Returns nearest node.
 * @param node DetailNode node.
 * @return nearest node.
 */
private static DetailNode getNearestNode(DetailNode node) {
    DetailNode tag = JavadocUtils.getNextSibling(node);
    while (tag.getType() == JavadocTokenTypes.LEADING_ASTERISK
            || tag.getType() == JavadocTokenTypes.NEWLINE) {
        tag = JavadocUtils.getNextSibling(tag);
    }
    return tag;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:13,代码来源:JavadocParagraphCheck.java

示例4: 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


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