use of com.puppycrawl.tools.checkstyle.api.TextBlock in project checkstyle by checkstyle.
the class JavadocMethodCheck method processAST.
@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);
}
}
}
use of com.puppycrawl.tools.checkstyle.api.TextBlock in project checkstyle by checkstyle.
the class SuppressWithNearbyCommentFilter method tagSuppressions.
/**
* Appends the suppressions in a collection of comments to the full
* set of suppression tags.
* @param comments the set of comments.
*/
private void tagSuppressions(Collection<TextBlock> comments) {
for (final TextBlock comment : comments) {
final int startLineNo = comment.getStartLineNo();
final String[] text = comment.getText();
tagCommentLine(text[0], startLineNo);
for (int i = 1; i < text.length; i++) {
tagCommentLine(text[i], startLineNo + i);
}
}
}