org.incava.doctorj
Class ExceptionDocAnalyzer
public class ExceptionDocAnalyzer
Checks for violations of rules applying to exceptions.
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
ExceptionDocAnalyzer
public ExceptionDocAnalyzer(Report report,
JavadocNode javadoc,
net.sourceforge.pmd.ast.SimpleNode function,
int nodeLevel)
Creates and runs the exception documentation analyzer.
report
- The report to which to send violations.javadoc
- The javadoc for the function. Should not be null.function
- The constructor or method.
checkAgainstCode
protected void checkAgainstCode(JavadocTag tag,
JavadocElement tgt,
String shortExcName,
String fullExcName,
Class excClass)
getClosestMatchingException
protected net.sourceforge.pmd.ast.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 net.sourceforge.pmd.ast.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(net.sourceforge.pmd.ast.ASTImportDeclaration[] imports)
reportUndocumentedExceptions
protected void reportUndocumentedExceptions()