public class AtclauseOrderCheck extends AbstractJavadocCheck
Checks the order of javadoc block-tags or javadoc tags.
Note: Google used term "at-clauses" for block tags in his guide till 2017-02-28.
The check allows to configure itself by using the following properties:
Default configuration:
<module name="AtclauseOrderCheck"> <property name="tagOrder" value="@author, @version, @param, @return, @throws, @exception, @see, @since, @serial, @serialField, @serialData, @deprecated"/> <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> </module>
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
DEFAULT_ORDER
Default order of atclauses.
|
static java.lang.String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
file.
|
private java.util.List<java.lang.String> |
tagOrder
Order of atclauses.
|
private java.util.List<java.lang.Integer> |
target
Default target of checking atclauses.
|
MSG_JAVADOC_MISSED_HTML_CLOSE, MSG_JAVADOC_PARSE_RULE_ERROR, MSG_JAVADOC_WRONG_SINGLETON_TAG, MSG_KEY_PARSE_ERROR, MSG_KEY_UNRECOGNIZED_ANTLR_ERROR
Constructor and Description |
---|
AtclauseOrderCheck() |
Modifier and Type | Method and Description |
---|---|
private void |
checkOrderInTagSection(DetailNode javadoc)
Checks order of atclauses in tag section node.
|
int[] |
getDefaultJavadocTokens()
Returns the default javadoc token types a check is interested in.
|
private static int |
getParentType(DetailAST commentBlock)
Returns type of parent node.
|
int[] |
getRequiredJavadocTokens()
The javadoc tokens that this check must be registered for.
|
void |
setTagOrder(java.lang.String... orders)
Sets custom order of atclauses.
|
void |
setTarget(java.lang.String... targets)
Sets custom targets.
|
void |
visitJavadocToken(DetailNode ast)
Called to process a Javadoc token.
|
beginJavadocTree, beginTree, finishJavadocTree, finishTree, getAcceptableJavadocTokens, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, visitToken
destroy, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final java.lang.String MSG_KEY
private static final java.lang.String[] DEFAULT_ORDER
private java.util.List<java.lang.Integer> target
private java.util.List<java.lang.String> tagOrder
public void setTarget(java.lang.String... targets)
targets
- user's targets.public void setTagOrder(java.lang.String... orders)
orders
- user's orders.public int[] getDefaultJavadocTokens()
AbstractJavadocCheck
getDefaultJavadocTokens
in class AbstractJavadocCheck
JavadocTokenTypes
public int[] getRequiredJavadocTokens()
AbstractJavadocCheck
getRequiredJavadocTokens
in class AbstractJavadocCheck
JavadocTokenTypes
public void visitJavadocToken(DetailNode ast)
AbstractJavadocCheck
visitJavadocToken
in class AbstractJavadocCheck
ast
- the token to processprivate void checkOrderInTagSection(DetailNode javadoc)
javadoc
- Javadoc root node.private static int getParentType(DetailAST commentBlock)
commentBlock
- child node.