public class ExceptionDocAnalyzer extends DocAnalyzer
Modifier and Type | Field and Description |
---|---|
protected static int |
CHKLVL_EXCEPTION_DOC_EXISTS |
protected static int |
CHKLVL_EXCEPTIONS_ALPHABETICAL |
protected static java.lang.String[] |
KNOWN_RUNTIME_EXCEPTIONS |
static java.lang.String |
MSG_EXCEPTION_MISSPELLED |
static java.lang.String |
MSG_EXCEPTION_NOT_DOCUMENTED |
static java.lang.String |
MSG_EXCEPTION_NOT_IN_THROWS_LIST |
static java.lang.String |
MSG_EXCEPTION_WITHOUT_CLASS_NAME |
static java.lang.String |
MSG_EXCEPTION_WITHOUT_DESCRIPTION |
static java.lang.String |
MSG_EXCEPTIONS_NOT_ALPHABETICAL |
CHKLVL_DOC_EXISTS, CHKLVL_TAG_CONTENT
Constructor and Description |
---|
ExceptionDocAnalyzer(Report report,
JavadocNode javadoc,
SimpleNode function,
int nodeLevel)
Creates and runs the exception documentation analyzer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAgainstCode(JavadocTag tag,
JavadocElement tgt,
java.lang.String shortExcName,
java.lang.String fullExcName,
java.lang.Class excClass) |
protected ASTName |
getClosestMatchingException(java.lang.String str)
Returns the name in the list that most closely matches the given string.
|
protected java.lang.String |
getExactMatch(java.lang.String name) |
protected ASTName |
getMatchingException(java.lang.String str)
Returns the first name in the list that matches the given string.
|
protected java.lang.String |
getShortName(java.lang.String name)
Returns the short name of the class, e.g., Integer instead of
java.lang.Integer.
|
protected boolean |
isRuntimeException(java.lang.Class excClass)
Returns whether the given class is derived from Runtimeexception or
Error.
|
protected java.lang.Class |
loadClass(java.lang.String clsName) |
protected java.util.Map |
makeImportMap(ASTImportDeclaration[] imports) |
protected void |
reportUndocumentedExceptions() |
void |
run() |
isCheckable
addViolation, addViolation, addViolation, getReport
public static final java.lang.String MSG_EXCEPTION_WITHOUT_CLASS_NAME
public static final java.lang.String MSG_EXCEPTION_WITHOUT_DESCRIPTION
public static final java.lang.String MSG_EXCEPTIONS_NOT_ALPHABETICAL
public static final java.lang.String MSG_EXCEPTION_NOT_IN_THROWS_LIST
public static final java.lang.String MSG_EXCEPTION_MISSPELLED
public static final java.lang.String MSG_EXCEPTION_NOT_DOCUMENTED
protected static final int CHKLVL_EXCEPTIONS_ALPHABETICAL
protected static final int CHKLVL_EXCEPTION_DOC_EXISTS
protected static final java.lang.String[] KNOWN_RUNTIME_EXCEPTIONS
public ExceptionDocAnalyzer(Report report, JavadocNode javadoc, SimpleNode function, int nodeLevel)
report
- The report to which to send violations.javadoc
- The javadoc for the function. Should not be null.function
- The constructor or method.public void run()
protected java.util.Map makeImportMap(ASTImportDeclaration[] imports)
protected java.lang.String getShortName(java.lang.String name)
protected java.lang.String getExactMatch(java.lang.String name)
protected java.lang.Class loadClass(java.lang.String clsName)
protected boolean isRuntimeException(java.lang.Class excClass)
protected void checkAgainstCode(JavadocTag tag, JavadocElement tgt, java.lang.String shortExcName, java.lang.String fullExcName, java.lang.Class excClass)
protected void reportUndocumentedExceptions()
protected ASTName getMatchingException(java.lang.String str)
protected ASTName getClosestMatchingException(java.lang.String str)