Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.javadoc
Class JavadocTypeCheck  view JavadocTypeCheck download JavadocTypeCheck.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.api.Check
              extended bycom.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck
All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable

public class JavadocTypeCheck
extends com.puppycrawl.tools.checkstyle.api.Check

Checks the Javadoc of a type. By default, does not check for author or version tags. The scope to verify is specified using the com.puppycrawl.tools.checkstyle.api.Scope class and defaults to Scope.PRIVATE>Scope.PRIVATE 55 . To verify another scope, set property scope to one of the com.puppycrawl.tools.checkstyle.api.Scope constants. To define the format for an author tag or a version tag, set property authorFormat or versionFormat respectively to a regular expression.

An example of how to configure the check is:

 <module name="JavadocType"/>
 

An example of how to configure the check for the Scope.PUBLIC>Scope.PUBLIC 55 scope is:

 <module name="JavadocType">
    <property name="scope" value="public"/>
 </module>
 

An example of how to configure the check for an author tag and a version tag is:

 <module name="JavadocType">
    <property name="authorFormat" value="\S"/>
    <property name="versionFormat" value="\S"/>
 </module>
 

An example of how to configure the check for a CVS revision version tag is:

 <module name="JavadocType">
    <property name="versionFormat" value="\$Revision.*\$"/>
 </module>
 

Version:
1.0

Field Summary
private  java.lang.String mAuthorFormat
          regexp to match author tag content
private  org.apache.regexp.RE mAuthorFormatRE
          compiled regexp to match author tag content
private  org.apache.regexp.RE mAuthorTagRE
          compiled regexp to match author tag
private  com.puppycrawl.tools.checkstyle.api.Scope mScope
          the scope to check for
private  java.lang.String mVersionFormat
          regexp to match version tag content
private  org.apache.regexp.RE mVersionFormatRE
          compiled regexp to match version tag content
private  org.apache.regexp.RE mVersionTagRE
          compiled regexp to match version tag
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.Check
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
 
Constructor Summary
JavadocTypeCheck()
           
 
Method Summary
private  void checkTag(int aLineNo, java.lang.String[] aCmt, java.lang.String aTag, org.apache.regexp.RE aTagRE, org.apache.regexp.RE aFormatRE, java.lang.String aFormat)
          Verifies that a type definition has a required tag.
 int[] getDefaultTokens()
          Returns the default token a check is interested in.
 void setAuthorFormat(java.lang.String aFormat)
          Set the author tag pattern.
 void setScope(java.lang.String aFrom)
          Sets the scope to check.
 void setVersionFormat(java.lang.String aFormat)
          Set the version format pattern.
 void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Called to process a token.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, 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, 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
 

Field Detail

mScope

private com.puppycrawl.tools.checkstyle.api.Scope mScope
the scope to check for


mAuthorTagRE

private org.apache.regexp.RE mAuthorTagRE
compiled regexp to match author tag


mAuthorFormatRE

private org.apache.regexp.RE mAuthorFormatRE
compiled regexp to match author tag content


mVersionTagRE

private org.apache.regexp.RE mVersionTagRE
compiled regexp to match version tag


mVersionFormatRE

private org.apache.regexp.RE mVersionFormatRE
compiled regexp to match version tag content


mAuthorFormat

private java.lang.String mAuthorFormat
regexp to match author tag content


mVersionFormat

private java.lang.String mVersionFormat
regexp to match version tag content

Constructor Detail

JavadocTypeCheck

public JavadocTypeCheck()
Method Detail

setScope

public void setScope(java.lang.String aFrom)
Sets the scope to check.


setAuthorFormat

public void setAuthorFormat(java.lang.String aFormat)
                     throws org.apache.commons.beanutils.ConversionException
Set the author tag pattern.


setVersionFormat

public void setVersionFormat(java.lang.String aFormat)
                      throws org.apache.commons.beanutils.ConversionException
Set the version format pattern.


getDefaultTokens

public int[] getDefaultTokens()
Description copied from class: com.puppycrawl.tools.checkstyle.api.Check
Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.


visitToken

public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
Description copied from class: com.puppycrawl.tools.checkstyle.api.Check
Called to process a token.


checkTag

private void checkTag(int aLineNo,
                      java.lang.String[] aCmt,
                      java.lang.String aTag,
                      org.apache.regexp.RE aTagRE,
                      org.apache.regexp.RE aFormatRE,
                      java.lang.String aFormat)
Verifies that a type definition has a required tag.