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


Java FileContents.getJavadocBefore方法代码示例

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


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

示例1: processAST

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
protected final void processAST(DetailAST ast) {
    final Scope theScope = calculateScope(ast);
    if (shouldCheck(ast, theScope)) {
        final FileContents contents = getFileContents();
        final TextBlock textBlock = contents.getJavadocBefore(ast.getLineNo());

        if (textBlock == null) {
            if (!isMissingJavadocAllowed(ast)) {
                log(ast, MSG_JAVADOC_MISSING);
            }
        }
        else {
            checkComment(ast, textBlock);
        }
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:18,代码来源:JavadocMethodCheck.java

示例2: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    if (shouldCheck(ast)) {
        final FileContents contents = getFileContents();
        // Need to start searching for the comment before the annotations
        // that may exist. Even if annotations are not defined on the
        // package, the ANNOTATIONS AST is defined.
        final TextBlock textBlock =
            contents.getJavadocBefore(ast.getFirstChild().getLineNo());

        checkComment(ast, textBlock);
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:14,代码来源:JavadocStyleCheck.java

示例3: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    if (shouldCheck(ast)) {
        final FileContents contents = getFileContents();
        final int lineNo = ast.getLineNo();
        final TextBlock textBlock = contents.getJavadocBefore(lineNo);
        if (textBlock == null) {
            log(lineNo, MSG_JAVADOC_MISSING);
        }
        else {
            final List<JavadocTag> tags = getJavadocTags(textBlock);
            if (ScopeUtils.isOuterMostType(ast)) {
                // don't check author/version for inner classes
                checkTag(lineNo, tags, JavadocTagInfo.AUTHOR.getName(),
                        authorFormat);
                checkTag(lineNo, tags, JavadocTagInfo.VERSION.getName(),
                        versionFormat);
            }

            final List<String> typeParamNames =
                CheckUtils.getTypeParameterNames(ast);

            if (!allowMissingParamTags) {
                //Check type parameters that should exist, do
                for (final String typeParamName : typeParamNames) {
                    checkTypeParamTag(
                        lineNo, tags, typeParamName);
                }
            }

            checkUnusedTypeParamTags(tags, typeParamNames);
        }
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:35,代码来源:JavadocTypeCheck.java

示例4: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    final FileContents contents = getFileContents();
    final int lineNo = ast.getLineNo();
    final TextBlock cmt =
        contents.getJavadocBefore(lineNo);
    if (cmt == null) {
        log(lineNo, MSG_MISSING_TAG, tag);
    }
    else {
        checkTag(lineNo, cmt.getText());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:14,代码来源:WriteTagCheck.java

示例5: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    if (shouldCheck(ast)) {
        final FileContents contents = getFileContents();
        final TextBlock textBlock =
            contents.getJavadocBefore(ast.getLineNo());

        if (textBlock == null) {
            log(ast, MSG_JAVADOC_MISSING);
        }
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:13,代码来源:JavadocVariableCheck.java

示例6: collectReferencesFromJavadoc

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
/**
 * Collects references made in Javadoc comments.
 * @param ast node to inspect for Javadoc
 */
private void collectReferencesFromJavadoc(DetailAST ast) {
    final FileContents contents = getFileContents();
    final int lineNo = ast.getLineNo();
    final TextBlock textBlock = contents.getJavadocBefore(lineNo);
    if (textBlock != null) {
        referenced.addAll(collectReferencesFromJavadoc(textBlock));
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:13,代码来源:UnusedImportsCheck.java

示例7: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(final DetailAST ast) {
    if (AnnotationUtility.containsAnnotation(ast, "Override")) {
        final FileContents contents = getFileContents();
        final TextBlock javadoc = contents.getJavadocBefore(
            ast.getLineNo()
        );
        if (javadoc != null) {
            log(ast, "Overridden methods should not have Javadoc");
        }
    }
}
 
开发者ID:teamed,项目名称:qulice,代码行数:13,代码来源:NoJavadocForOverriddenMethodsCheck.java

示例8: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST aAST) {
    if (shouldCheck(aAST)) {
        final FileContents contents = getFileContents();
        final int lineNo = aAST.getLineNo();
        final TextBlock cmt = contents.getJavadocBefore(lineNo);
        if (cmt == null) {
            log(lineNo, "javadoc.missing");
        } else if (ScopeUtils.isOuterMostType(aAST)) {
            // don't check author/version for inner classes
            final List<JavadocTag> tags = getJavadocTags(cmt);
            checkTag(lineNo, tags, JavadocTagInfo.AUTHOR.getName(), mAuthorFormatPattern, mAuthorFormat);
            checkTag(lineNo, tags, JavadocTagInfo.VERSION.getName(), mVersionFormatPattern, mVersionFormat);

            final List<String> typeParamNames = CheckUtils.getTypeParameterNames(aAST);

            if (!mAllowMissingParamTags) {
                // Check type parameters that should exist, do
                for (final String string : typeParamNames) {
                    checkTypeParamTag(lineNo, tags, string);
                }
            }

            checkUnusedTypeParamTags(tags, typeParamNames);
        }
    }
}
 
开发者ID:Adobe-Consulting-Services,项目名称:checkstyle-osgi-checks,代码行数:28,代码来源:ExportedJavadocTypeCheck.java

示例9: visitToken

import com.puppycrawl.tools.checkstyle.api.FileContents; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST aAST) {
    if (shouldCheck(aAST)) {
        final FileContents contents = getFileContents();
        final TextBlock cmt = contents.getJavadocBefore(aAST.getLineNo());

        if (cmt == null) {
            log(aAST, "javadoc.missing");
        }
    }
}
 
开发者ID:Adobe-Consulting-Services,项目名称:checkstyle-osgi-checks,代码行数:12,代码来源:ExportedJavadocVariableCheck.java


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