com.puppycrawl.tools.checkstyle.checks.javadoc
Class JavadocStyleCheck
- Configurable, Contextualizable
public class JavadocStyleCheck
Custom Checkstyle Check to validate Javadoc.
The following checks are performed:
- Ensures the first sentence ends with proper punctuation (That is
a period, question mark, or exclaimation mark). Javadoc automatically
places the first sentence in the method summary table and index. With out
proper punctuation the Javadoc may be malformed.
- Check text for Javadoc statements that do not have any description.
This includes both completely empty Javadoc, and Javadoc with only
tags such as @param and @return.
- Check text for incomplete html tags. Verifies that HTML tags have
corresponding end tags and issues an UNCLOSED_HTML error if not.
An EXTRA_HTML error is issued if an end tag is found without a previous
open tag.
These checks were patterned after the checks made by the doclet
com.sun.tools.doclets.doccheck.DocCheck
Version:
- Chris Stillwell
- Daniel Grenner
int[] | getDefaultTokens() - The default tokens this Check is used for.
|
void | setCheckEmptyJavadoc(boolean aFlag) - Sets the flag that determines if empty JavaDoc checking should be done.
|
void | setCheckFirstSentence(boolean aFlag) - Sets the flag that determines if the first sentence is checked for
proper end of sentence punctuation.
|
void | setCheckHtml(boolean aFlag) - Sets the flag that determines if HTML checking is to be performed.
|
void | setExcludeScope(String aScope) - Set the excludeScope.
|
void | setScope(String aFrom) - Sets the scope to check.
|
void | visitToken(DetailAST aAST) - Called to process a token.
|
beginTree , destroy , finishTree , getAcceptableTokens , getClassLoader , getDefaultTokens , getFileContents , getLines , getRequiredTokens , getTabWidth , getTokenNames , init , leaveToken , log , log , setClassLoader , setFileContents , setMessages , setTabWidth , setTokens , visitToken |
getMessageBundle , getSeverity , getSeverityLevel , log , log , log , log , log , log , log , log , log , log , log , setSeverity |
getDefaultTokens
public int[] getDefaultTokens()
The default tokens this Check is used for.
- getDefaultTokens in interface Check
Check.getDefaultTokens()
setCheckEmptyJavadoc
public void setCheckEmptyJavadoc(boolean aFlag)
Sets the flag that determines if empty JavaDoc checking should be done.
aFlag
- true
if empty JavaDoc checking should be done.
setCheckFirstSentence
public void setCheckFirstSentence(boolean aFlag)
Sets the flag that determines if the first sentence is checked for
proper end of sentence punctuation.
aFlag
- true
if the first sentence is to be checked
setCheckHtml
public void setCheckHtml(boolean aFlag)
Sets the flag that determines if HTML checking is to be performed.
aFlag
- true
if HTML checking is to be performed.
setExcludeScope
public void setExcludeScope(String aScope)
Set the excludeScope.
aScope
- a String
value
setScope
public void setScope(String aFrom)
Sets the scope to check.
aFrom
- string to get the scope from
visitToken
public void visitToken(DetailAST aAST)
Called to process a token.
- visitToken in interface Check
Check