org.incava.doctorj
Class ParameterDocAnalyzer

java.lang.Object
  extended by org.incava.analysis.Analyzer
      extended by org.incava.doctorj.DocAnalyzer
          extended by org.incava.doctorj.ParameterDocAnalyzer

public class ParameterDocAnalyzer
extends DocAnalyzer

Checks the validity of Javadoc for a list of parameters.


Field Summary
protected static int CHKLVL_PARAM_DOC_EXISTS
          The warning level for checking for the existence of Javadoc for parameters.
static java.lang.String MSG_PARAMETER_MISSPELLED
          The message for a parameter being apparently misspelled from that in the code.
static java.lang.String MSG_PARAMETER_NOT_DOCUMENTED
          The message for an undocumented code parameter.
static java.lang.String MSG_PARAMETER_NOT_IN_CODE
          The message for a documented parameter not found in the code.
static java.lang.String MSG_PARAMETER_NOT_IN_CODE_ORDER
          The message for parameters being misordered with regard to the code.
static java.lang.String MSG_PARAMETER_REPEATED
          The message for a repeated documented parameter.
static java.lang.String MSG_PARAMETER_TYPE_USED
          The message for a parameter referring to argument type, not name.
static java.lang.String MSG_PARAMETER_WITHOUT_DESCRIPTION
          The message for a parameter field without a description.
static java.lang.String MSG_PARAMETER_WITHOUT_NAME
          The message for a parameter field without a name.
static java.lang.String MSG_PARAMETERS_DOCUMENTED_BUT_NO_CODE_PARAMETERS
          The message for documented parameters for a function without any in the code.
 
Fields inherited from class org.incava.doctorj.DocAnalyzer
CHKLVL_DOC_EXISTS, CHKLVL_TAG_CONTENT
 
Constructor Summary
ParameterDocAnalyzer(Report report, JavadocNode javadoc, SimpleNode function, ASTFormalParameters parameterList, int nodeLevel)
          Creates and runs the parameter documentation analyzer.
 
Method Summary
protected  void addDocumentedParameter(int index, Location start, Location end)
           
protected  int getClosestMatchingParameter(java.lang.String str)
          Returns the first param in the list whose name most closely matches the given string.
protected  int getMatchingParameter(java.lang.String str)
          Returns the first param in the list whose name matches the given string.
protected  void reportUndocumentedParameters()
           
 void run()
          Analyzes the Javadoc for the parameter list.
 
Methods inherited from class org.incava.doctorj.DocAnalyzer
isCheckable
 
Methods inherited from class org.incava.analysis.Analyzer
addViolation, addViolation, addViolation, getReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_PARAMETERS_DOCUMENTED_BUT_NO_CODE_PARAMETERS

public static final java.lang.String MSG_PARAMETERS_DOCUMENTED_BUT_NO_CODE_PARAMETERS
The message for documented parameters for a function without any in the code.

See Also:
Constant Field Values

MSG_PARAMETER_WITHOUT_NAME

public static final java.lang.String MSG_PARAMETER_WITHOUT_NAME
The message for a parameter field without a name.

See Also:
Constant Field Values

MSG_PARAMETER_WITHOUT_DESCRIPTION

public static final java.lang.String MSG_PARAMETER_WITHOUT_DESCRIPTION
The message for a parameter field without a description.

See Also:
Constant Field Values

MSG_PARAMETER_NOT_IN_CODE_ORDER

public static final java.lang.String MSG_PARAMETER_NOT_IN_CODE_ORDER
The message for parameters being misordered with regard to the code.

See Also:
Constant Field Values

MSG_PARAMETER_MISSPELLED

public static final java.lang.String MSG_PARAMETER_MISSPELLED
The message for a parameter being apparently misspelled from that in the code.

See Also:
Constant Field Values

MSG_PARAMETER_TYPE_USED

public static final java.lang.String MSG_PARAMETER_TYPE_USED
The message for a parameter referring to argument type, not name.

See Also:
Constant Field Values

MSG_PARAMETER_NOT_DOCUMENTED

public static final java.lang.String MSG_PARAMETER_NOT_DOCUMENTED
The message for an undocumented code parameter.

See Also:
Constant Field Values

MSG_PARAMETER_NOT_IN_CODE

public static final java.lang.String MSG_PARAMETER_NOT_IN_CODE
The message for a documented parameter not found in the code.

See Also:
Constant Field Values

MSG_PARAMETER_REPEATED

public static final java.lang.String MSG_PARAMETER_REPEATED
The message for a repeated documented parameter.

See Also:
Constant Field Values

CHKLVL_PARAM_DOC_EXISTS

protected static final int CHKLVL_PARAM_DOC_EXISTS
The warning level for checking for the existence of Javadoc for parameters.

See Also:
Constant Field Values
Constructor Detail

ParameterDocAnalyzer

public ParameterDocAnalyzer(Report report,
                            JavadocNode javadoc,
                            SimpleNode function,
                            ASTFormalParameters parameterList,
                            int nodeLevel)
Creates and runs the parameter documentation analyzer.

Parameters:
report - The report to which to send violations.
javadoc - The javadoc for the function. Should not be null.
function - The constructor or method.
Method Detail

run

public void run()
Analyzes the Javadoc for the parameter list.


addDocumentedParameter

protected void addDocumentedParameter(int index,
                                      Location start,
                                      Location end)

reportUndocumentedParameters

protected void reportUndocumentedParameters()

getMatchingParameter

protected int getMatchingParameter(java.lang.String str)
Returns the first param in the list whose name matches the given string.


getClosestMatchingParameter

protected int getClosestMatchingParameter(java.lang.String str)
Returns the first param in the list whose name most closely matches the given string.