Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.puppycrawl.tools.checkstyle.checks.javadoc
Class JavadocMethodCheck

    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

All Implemented Interfaces:
  Configurable, Contextualizable

    public class JavadocMethodCheck

extends AbstractTypeAwareCheck

Checks the Javadoc of a method or constructor.

Version:
  1.1
Author:
  Oliver Burn, Rick Giles, o_sukhodoslky

Nested Class Summary

Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
`AbstractTypeAwareCheck.ClassInfo, AbstractTypeAwareCheck.Token`

Constructor Summary
`JavadocMethodCheck()`

Method Summary
`int[]` | `getAcceptableTokens()` The configurable token set.
`int[]` | `getDefaultTokens()` Returns the default token a check is interested in.
`protected boolean` | `isMissingJavadocAllowed(DetailAST aAST)` The JavadocMethodCheck is about to report a missing Javadoc.
`protected void` | `logLoadError(AbstractTypeAwareCheck.Token aIdent)` Logs error if unable to load class information.
`protected void` | `processAST(DetailAST aAST)` Checks Javadoc comments for a method or constructor.
`void` | `setAllowMissingJavadoc(boolean aFlag)` Controls whether to ignore errors when there is no javadoc.
`void` | `setAllowMissingParamTags(boolean aFlag)` controls whether to allow a method which has parameters to omit matching param tags in the javadoc.
`void` | `setAllowMissingPropertyJavadoc(boolean aFlag)` Controls whether to ignore errors when there is no javadoc for a property accessor (setter/getter methods).
`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(String aScope)` Set the excludeScope.
`void` | `setScope(String aFrom)` Set the scope.

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
`beginTree, createClassInfo, findClassAlias, getCurrentClassName, getRequiredTokens, isSubclass, isUnchecked, leaveAST, leaveToken, logLoadErrorImpl, resolveClass, setLogLoadErrors, setSuppressLoadErrors, 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
`getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setId, 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

### JavadocMethodCheck

    public JavadocMethodCheck()

Method Detail

### setScope

    public void setScope(String aFrom)

  Set the scope.

  Parameters:
    `aFrom` - a `String` value

### setExcludeScope

    public void setExcludeScope(String aScope)

  Set the excludeScope.

  Parameters:
    `aScope` - a `String` value

### setAllowUndeclaredRTE

    public void setAllowUndeclaredRTE(boolean aFlag)

  controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowThrowsTagsForSubclasses

    public void setAllowThrowsTagsForSubclasses(boolean aFlag)

  controls whether to allow documented exception that are subclass of one of declared exceptions.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowMissingParamTags

    public void setAllowMissingParamTags(boolean aFlag)

  controls whether to allow a method which has parameters to omit matching param tags in the javadoc. Defaults to false.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowMissingThrowsTags

    public void setAllowMissingThrowsTags(boolean aFlag)

  controls whether to allow a method which declares that it throws exceptions to omit matching throws tags in the javadoc. Defaults to false.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowMissingReturnTag

    public void setAllowMissingReturnTag(boolean aFlag)

  controls whether to allow a method which returns non-void type to omit the return tag in the javadoc. Defaults to false.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowMissingJavadoc

    public void setAllowMissingJavadoc(boolean aFlag)

  Controls whether to ignore errors when there is no javadoc. Defaults to false.

  Parameters:
    `aFlag` - a `Boolean` value

### setAllowMissingPropertyJavadoc

    public void setAllowMissingPropertyJavadoc(boolean aFlag)

  Controls whether to ignore errors when there is no javadoc for a property accessor (setter/getter methods). Defaults to false.

  Parameters:
    `aFlag` - a `Boolean` value

### getDefaultTokens

    public int[] getDefaultTokens()

  Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.

  Specified by:
    `getDefaultTokens` in class `Check`
  Returns:
    the default tokens
  See Also:
    `TokenTypes`

### getAcceptableTokens

    public int[] getAcceptableTokens()

  The configurable token set. Used to protect Checks against malicious users who specify an unacceptable token set in the configuration file. The default implementation returns the check's default tokens.

  Overrides:
    `getAcceptableTokens` in class `Check`
  Returns:
    the token set this check is designed for.
  See Also:
    `TokenTypes`

### processAST

    protected final void processAST(DetailAST aAST)

  Checks Javadoc comments for a method or constructor.

  Specified by:
    `processAST` in class `AbstractTypeAwareCheck`
  Parameters:
    `aAST` - the tree node for the method or constructor.

### logLoadError

    protected final void logLoadError(AbstractTypeAwareCheck.Token aIdent)

  Logs error if unable to load class information.

  Specified by:
    `logLoadError` in class `AbstractTypeAwareCheck`
  Parameters:
    `aIdent` - class name for which we can no load class.

### isMissingJavadocAllowed

    protected boolean isMissingJavadocAllowed(DetailAST aAST)

  The JavadocMethodCheck is about to report a missing Javadoc. This hook can be used by derived classes to allow a missing javadoc in some situations. The default implementation checks `allowMissingJavadoc` and `allowMissingPropertyJavadoc` properties, do not forget to call `super.isMissingJavadocAllowed(aAST)` in case you want to keep this logic.

  Parameters:
    `aAST` - the tree node for the method or constructor.
  Returns:
    True if this method or constructor doesn't need Javadoc.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Back to the Checkstyle Home Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD