org.incava.doctorj

Class ExceptionDocAnalyzer

public class ExceptionDocAnalyzer extends DocAnalyzer

Checks for violations of rules applying to exceptions.
Field Summary
protected static intCHKLVL_EXCEPTIONS_ALPHABETICAL
protected static intCHKLVL_EXCEPTION_DOC_EXISTS
protected static String[]KNOWN_RUNTIME_EXCEPTIONS
static StringMSG_EXCEPTIONS_NOT_ALPHABETICAL
static StringMSG_EXCEPTION_MISSPELLED
static StringMSG_EXCEPTION_NOT_DOCUMENTED
static StringMSG_EXCEPTION_NOT_IN_THROWS_LIST
static StringMSG_EXCEPTION_WITHOUT_CLASS_NAME
static StringMSG_EXCEPTION_WITHOUT_DESCRIPTION
Constructor Summary
ExceptionDocAnalyzer(Report report, JavadocNode javadoc, SimpleNode function, int nodeLevel)
Creates and runs the exception documentation analyzer.
Method Summary
protected voidcheckAgainstCode(JavadocTag tag, JavadocElement tgt, String shortExcName, String fullExcName, Class excClass)
protected ASTNamegetClosestMatchingException(String str)
Returns the name in the list that most closely matches the given string.
protected StringgetExactMatch(String name)
protected ASTNamegetMatchingException(String str)
Returns the first name in the list that matches the given string.
protected StringgetShortName(String name)
Returns the short name of the class, e.g., Integer instead of java.lang.Integer.
protected booleanisRuntimeException(Class excClass)
Returns whether the given class is derived from Runtimeexception or Error.
protected ClassloadClass(String clsName)
protected MapmakeImportMap(ASTImportDeclaration[] imports)
protected voidreportUndocumentedExceptions()
voidrun()

Field Detail

CHKLVL_EXCEPTIONS_ALPHABETICAL

protected static final int CHKLVL_EXCEPTIONS_ALPHABETICAL

CHKLVL_EXCEPTION_DOC_EXISTS

protected static final int CHKLVL_EXCEPTION_DOC_EXISTS

KNOWN_RUNTIME_EXCEPTIONS

protected static final String[] KNOWN_RUNTIME_EXCEPTIONS

MSG_EXCEPTIONS_NOT_ALPHABETICAL

public static final String MSG_EXCEPTIONS_NOT_ALPHABETICAL

MSG_EXCEPTION_MISSPELLED

public static final String MSG_EXCEPTION_MISSPELLED

MSG_EXCEPTION_NOT_DOCUMENTED

public static final String MSG_EXCEPTION_NOT_DOCUMENTED

MSG_EXCEPTION_NOT_IN_THROWS_LIST

public static final String MSG_EXCEPTION_NOT_IN_THROWS_LIST

MSG_EXCEPTION_WITHOUT_CLASS_NAME

public static final String MSG_EXCEPTION_WITHOUT_CLASS_NAME

MSG_EXCEPTION_WITHOUT_DESCRIPTION

public static final String MSG_EXCEPTION_WITHOUT_DESCRIPTION

Constructor Detail

ExceptionDocAnalyzer

public ExceptionDocAnalyzer(Report report, JavadocNode javadoc, SimpleNode function, int nodeLevel)
Creates and runs the exception 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

checkAgainstCode

protected void checkAgainstCode(JavadocTag tag, JavadocElement tgt, String shortExcName, String fullExcName, Class excClass)

getClosestMatchingException

protected ASTName getClosestMatchingException(String str)
Returns the name in the list that most closely matches the given string.

getExactMatch

protected String getExactMatch(String name)

getMatchingException

protected ASTName getMatchingException(String str)
Returns the first name in the list that matches the given string.

getShortName

protected String getShortName(String name)
Returns the short name of the class, e.g., Integer instead of java.lang.Integer.

isRuntimeException

protected boolean isRuntimeException(Class excClass)
Returns whether the given class is derived from Runtimeexception or Error.

loadClass

protected Class loadClass(String clsName)

makeImportMap

protected Map makeImportMap(ASTImportDeclaration[] imports)

reportUndocumentedExceptions

protected void reportUndocumentedExceptions()

run

public void run()