public final class MissingDeprecatedCheck extends Check
This class is used to verify that both the
Deprecated
annotation
and the deprecated javadoc tag are present when
either one is present.
Both ways of flagging deprecation serve their own purpose. The
Deprecated
annotation is used for
compilers and development tools. The deprecated javadoc tag is
used to document why something is deprecated and what, if any,
alternatives exist.
In order to properly mark something as deprecated both forms of deprecation should be present.
Package deprecation is a exception to the rule of always using the javadoc tag and annotation to deprecate. Only the package-info.java file can contain a Deprecated annotation and it CANNOT contain a deprecated javadoc tag. This is the case with Sun's javadoc tool released with JDK 1.6.0_11. As a result, this check does not deal with Deprecated packages in any way. No official documentation was found confirming this behavior is correct (of the javadoc tool).
To configure this check do the following:
<module name="JavadocDeprecated"/>
Modifier and Type | Field and Description |
---|---|
static String |
MSG_KEY_ANNOTATION_MISSING_DEPRECATED
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_KEY_JAVADOC_DUPLICATE_TAG
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_KEY_JAVADOC_MISSING
A key is pointing to the warning message text in "messages.properties"
file.
|
Constructor and Description |
---|
MissingDeprecatedCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final String MSG_KEY_ANNOTATION_MISSING_DEPRECATED
public static final String MSG_KEY_JAVADOC_DUPLICATE_TAG
public static final String MSG_KEY_JAVADOC_MISSING
public MissingDeprecatedCheck()
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public int[] getAcceptableTokens()
Check
getAcceptableTokens
in class Check
TokenTypes
public int[] getRequiredTokens()
Check
getRequiredTokens
in class Check
TokenTypes
public void visitToken(DetailAST ast)
Check
visitToken
in class Check
ast
- the token to processCopyright © 2001-2016. All Rights Reserved.