本文整理汇总了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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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());
}
}
示例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);
}
}
}
示例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));
}
}
示例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");
}
}
}
示例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