|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.puppycrawl.tools.checkstyle.api.AutomaticBean com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter com.puppycrawl.tools.checkstyle.api.Check com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck
Checks the Javadoc of a method or constructor.
By default, does not check for unused throws.
To allow documented java.lang.RuntimeException
s
that are not declared, set property allowUndeclaredRTE to true.
The scope to verify is specified using the Scope
class and
defaults to Scope.PRIVATE
. To verify another scope,
set property scope to one of the Scope
constants.
Error messages about parameters for which no param tags are
present can be suppressed by defining property
allowMissingParamTags
.
Error messages about exceptions which are declared to be thrown,
but for which no throws tag is present can be suppressed by
defining property allowMissingThrowsTags
.
Error messages about methods which return non-void but for
which no return tag is present can be suppressed by defining
property allowMissingReturnTag
.
An example of how to configure the check is:
<module name="JavadocMethod"/>
An example of how to configure the check to check to allow
documentation of undeclared RuntimeExceptions
and for the Scope.PUBLIC
scope, while ignoring any missing
param tags is:
<module name="JavadocMethod"> <property name="scope" value="public"/> <property name="allowUndeclaredRTE" value="true"/> <property name="allowMissingParamTags" value="true"/> </module>
Nested Class Summary |
Nested classes inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck |
AbstractTypeAwareCheck.ClassInfo |
Constructor Summary | |
JavadocMethodCheck()
Create an object. |
Method Summary | |
int[] |
getAcceptableTokens()
The configurable token set. |
int[] |
getDefaultTokens()
Returns the default token a check is interested in. |
int[] |
getRequiredTokens()
The tokens that this check must be registered for. |
protected void |
logLoadError(FullIdent aIdent)
Logs error if unable to load class information. |
protected void |
processAST(DetailAST aAST)
Checks Javadoc comments for a method or constructor. |
void |
setAllowMissingParamTags(boolean aFlag)
controls whether to allow a method which has parameters to omit matching param tags in the javadoc. |
void |
setAllowMissingReturnTag(boolean aFlag)
controls whether to allow a method which returns non-void type to omit the return tag in the javadoc. |
void |
setAllowMissingThrowsTags(boolean aFlag)
controls whether to allow a method which declares that it throws exceptions to omit matching throws tags in the javadoc. |
void |
setAllowThrowsTagsForSubclasses(boolean aFlag)
controls whether to allow documented exception that are subclass of one of declared exceptions. |
void |
setAllowUndeclaredRTE(boolean aFlag)
controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException. |
void |
setExcludeScope(java.lang.String aScope)
Set the excludeScope. |
void |
setScope(java.lang.String aFrom)
Set the scope. |
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck |
beginTree, getCurrentClassName, isSameType, isShortName, isSubclass, isUnchecked, leaveToken, resolveClass, tryLoadClass, visitToken |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
destroy, finishTree, getClassLoader, getFileContents, getLines, getTabWidth, getTokenNames, init, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavadocMethodCheck()
Method Detail |
public void setScope(java.lang.String aFrom)
aFrom
- a String
valuepublic void setExcludeScope(java.lang.String aScope)
aScope
- a String
valuepublic void setAllowUndeclaredRTE(boolean aFlag)
aFlag
- a Boolean
valuepublic void setAllowThrowsTagsForSubclasses(boolean aFlag)
aFlag
- a Boolean
valuepublic void setAllowMissingParamTags(boolean aFlag)
aFlag
- a Boolean
valuepublic void setAllowMissingThrowsTags(boolean aFlag)
aFlag
- a Boolean
valuepublic void setAllowMissingReturnTag(boolean aFlag)
aFlag
- a Boolean
valuepublic int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
Check
public int[] getAcceptableTokens()
Check
getAcceptableTokens
in class Check
Check
public int[] getRequiredTokens()
Check
getRequiredTokens
in class Check
Check
protected final void processAST(DetailAST aAST)
processAST
in class AbstractTypeAwareCheck
aAST
- the tree node for the method or constructor.protected final void logLoadError(FullIdent aIdent)
logLoadError
in class AbstractTypeAwareCheck
aIdent
- class name for which we can no load class.
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |