Class JavadocMethodCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
-
- com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public class JavadocMethodCheck extends AbstractTypeAwareCheck
Checks the Javadoc of a method or constructor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JavadocMethodCheck.ExceptionInfo
Stores useful information about declared exception.-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
AbstractTypeAwareCheck.AbstractClassInfo, AbstractTypeAwareCheck.Token
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
allowedAnnotations
List of annotations that could allow missed documentation.private boolean
allowMissingJavadoc
Controls whether to ignore errors when there is no javadoc.private boolean
allowMissingParamTags
Controls whether to ignore errors when a method has parameters but does not have matching param tags in the javadoc.private boolean
allowMissingPropertyJavadoc
Controls whether to allow missing Javadoc on accessor methods for properties (setters and getters).private boolean
allowMissingReturnTag
Controls whether to ignore errors when a method returns non-void type but does not have a return tag in the javadoc.private boolean
allowMissingThrowsTags
Controls whether to ignore errors when a method declares that it throws exceptions but does not have matching throws tags in the javadoc.private boolean
allowThrowsTagsForSubclasses
Controls whether to allow documented exceptions that are subclass of one of declared exception.private boolean
allowUndeclaredRTE
Controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.private static int
DEFAULT_MIN_LINE_COUNT
Default value of minimal amount of lines in method to demand documentation presence.private static java.lang.String
END_JAVADOC
Multiline finished at end of comment.private Scope
excludeScope
The visibility scope where Javadoc comments shouldn't be checked.private java.util.regex.Pattern
ignoreMethodNamesRegex
Method names that match this pattern do not require javadoc blocks.private static java.util.regex.Pattern
MATCH_JAVADOC_ARG
Compiled regexp to match Javadoc tags that take an argument.private static java.util.regex.Pattern
MATCH_JAVADOC_ARG_MULTILINE_START
Compiled regexp to match first part of multilineJavadoc tags.private static java.util.regex.Pattern
MATCH_JAVADOC_MULTILINE_CONT
Compiled regexp to look for a continuation of the comment.private static java.util.regex.Pattern
MATCH_JAVADOC_NOARG
Compiled regexp to match Javadoc tags with no argument.private static java.util.regex.Pattern
MATCH_JAVADOC_NOARG_CURLY
Compiled regexp to match Javadoc tags with no argument and {}.private static java.util.regex.Pattern
MATCH_JAVADOC_NOARG_MULTILINE_START
Compiled regexp to match first part of multilineJavadoc tags.private int
minLineCount
Minimal amount of lines in method to demand documentation presence.static java.lang.String
MSG_CLASS_INFO
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_DUPLICATE_TAG
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_EXPECTED_TAG
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_INVALID_INHERIT_DOC
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_JAVADOC_MISSING
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_RETURN_EXPECTED
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_UNUSED_TAG
A key is pointing to the warning message text in "messages.properties" file.static java.lang.String
MSG_UNUSED_TAG_GENERAL
A key is pointing to the warning message text in "messages.properties" file.private static java.lang.String
NEXT_TAG
Multiline finished at next Javadoc.private Scope
scope
The visibility scope where Javadoc comments are checked.private boolean
validateThrows
Allows validating throws tags.
-
Constructor Summary
Constructors Constructor Description JavadocMethodCheck()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Scope
calculateScope(DetailAST ast)
Returns the scope for the method/constructor at the specified AST.private static int
calculateTagColumn(java.util.regex.Matcher javadocTagMatcher, int lineNumber, int startColumnNumber)
Calculates column number using Javadoc tag matcher.private void
checkComment(DetailAST ast, TextBlock comment)
Checks the Javadoc for a method.private void
checkParamTags(java.util.List<JavadocTag> tags, DetailAST parent, boolean reportExpectedTags)
Checks a set of tags for matching parameters.private void
checkReturnTag(java.util.List<JavadocTag> tags, int lineNo, boolean reportExpectedTags)
Checks for only one return tag.private void
checkThrowsTags(java.util.List<JavadocTag> tags, java.util.List<JavadocMethodCheck.ExceptionInfo> throwsList, boolean reportExpectedTags)
Checks a set of tags for matching throws.int[]
getAcceptableTokens()
The configurable token set.int[]
getDefaultTokens()
Returns the default token a check is interested in.private static int
getMethodsNumberOfLine(DetailAST methodDef)
Some javadoc.private static java.util.List<JavadocTag>
getMethodTags(TextBlock comment)
Returns the tags in a javadoc comment.private static java.util.List<JavadocTag>
getMultilineArgTags(java.util.regex.Matcher argMultilineStart, int column, java.lang.String[] lines, int lineIndex, int tagLine)
Gets multiline Javadoc tags with arguments.private static java.util.List<JavadocTag>
getMultilineNoArgTags(java.util.regex.Matcher noargMultilineStart, java.lang.String[] lines, int lineIndex, int tagLine)
Gets multiline Javadoc tags with no arguments.private static java.util.List<DetailAST>
getParameters(DetailAST ast)
Computes the parameter nodes for a method.private java.util.List<JavadocMethodCheck.ExceptionInfo>
getThrows(DetailAST ast)
Computes the exception nodes for a method.private boolean
hasAllowedAnnotations(DetailAST methodDef)
Some javadoc.private boolean
hasShortCircuitTag(DetailAST ast, java.util.List<JavadocTag> tags)
Validates whether the Javadoc has a short circuit tag.boolean
isCommentNodesRequired()
Whether comment nodes are required or not.private boolean
isContentsAllowMissingJavadoc(DetailAST ast)
Checks if the Javadoc can be missing if the method or constructor is below the minimum line count or has a special annotation.private boolean
isInThrows(java.util.List<JavadocMethodCheck.ExceptionInfo> throwsList, AbstractTypeAwareCheck.AbstractClassInfo documentedClassInfo, java.util.Set<java.lang.String> foundThrows)
Verifies that documented exception is in throws.protected boolean
isMissingJavadocAllowed(DetailAST ast)
The JavadocMethodCheck is about to report a missing Javadoc.protected void
logLoadError(AbstractTypeAwareCheck.Token ident)
Logs error if unable to load class information.private boolean
matchesSkipRegex(DetailAST methodDef)
Checks if the given method name matches the regex.protected void
processAST(DetailAST ast)
Called to process an AST when visiting it.private static boolean
removeMatchingParam(java.util.List<DetailAST> params, java.lang.String paramName)
Remove parameter from params collection by name.private static boolean
searchMatchingTypeParameter(java.util.List<DetailAST> typeParams, java.lang.String requiredTypeName)
Returns true if required type found in type parameters.void
setAllowedAnnotations(java.lang.String... userAnnotations)
Sets list of annotations.void
setAllowMissingJavadoc(boolean flag)
Controls whether to ignore errors when there is no javadoc.void
setAllowMissingParamTags(boolean flag)
Controls whether to allow a method which has parameters to omit matching param tags in the javadoc.void
setAllowMissingPropertyJavadoc(boolean flag)
Controls whether to ignore errors when there is no javadoc for a property accessor (setter/getter methods).void
setAllowMissingReturnTag(boolean flag)
Controls whether to allow a method which returns non-void type to omit the return tag in the javadoc.void
setAllowMissingThrowsTags(boolean flag)
Controls whether to allow a method which declares that it throws exceptions to omit matching throws tags in the javadoc.void
setAllowThrowsTagsForSubclasses(boolean flag)
Controls whether to allow documented exception that are subclass of one of declared exceptions.void
setAllowUndeclaredRTE(boolean flag)
Controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.void
setExcludeScope(Scope excludeScope)
Set the excludeScope.void
setIgnoreMethodNamesRegex(java.util.regex.Pattern pattern)
Set regex for matching method names to ignore.void
setMinLineCount(int value)
Sets minimal amount of lines in method.void
setScope(Scope scope)
Set the scope.void
setValidateThrows(boolean value)
Allow validating throws tag.private boolean
shouldCheck(DetailAST ast, Scope nodeScope)
Whether we should check this node.-
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
beginTree, createClassInfo, findClassAlias, getCurrentClassName, getRequiredTokens, isSubclass, isUnchecked, leaveToken, logLoadErrorImpl, resolveClass, setLogLoadErrors, setSuppressLoadErrors, tryLoadClass, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
-
-
-
-
Field Detail
-
MSG_JAVADOC_MISSING
public static final java.lang.String MSG_JAVADOC_MISSING
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_CLASS_INFO
public static final java.lang.String MSG_CLASS_INFO
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_UNUSED_TAG_GENERAL
public static final java.lang.String MSG_UNUSED_TAG_GENERAL
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_INVALID_INHERIT_DOC
public static final java.lang.String MSG_INVALID_INHERIT_DOC
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_UNUSED_TAG
public static final java.lang.String MSG_UNUSED_TAG
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_EXPECTED_TAG
public static final java.lang.String MSG_EXPECTED_TAG
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_RETURN_EXPECTED
public static final java.lang.String MSG_RETURN_EXPECTED
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_DUPLICATE_TAG
public static final java.lang.String MSG_DUPLICATE_TAG
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MATCH_JAVADOC_ARG
private static final java.util.regex.Pattern MATCH_JAVADOC_ARG
Compiled regexp to match Javadoc tags that take an argument.
-
MATCH_JAVADOC_ARG_MULTILINE_START
private static final java.util.regex.Pattern MATCH_JAVADOC_ARG_MULTILINE_START
Compiled regexp to match first part of multilineJavadoc tags.
-
MATCH_JAVADOC_MULTILINE_CONT
private static final java.util.regex.Pattern MATCH_JAVADOC_MULTILINE_CONT
Compiled regexp to look for a continuation of the comment.
-
END_JAVADOC
private static final java.lang.String END_JAVADOC
Multiline finished at end of comment.- See Also:
- Constant Field Values
-
NEXT_TAG
private static final java.lang.String NEXT_TAG
Multiline finished at next Javadoc.- See Also:
- Constant Field Values
-
MATCH_JAVADOC_NOARG
private static final java.util.regex.Pattern MATCH_JAVADOC_NOARG
Compiled regexp to match Javadoc tags with no argument.
-
MATCH_JAVADOC_NOARG_MULTILINE_START
private static final java.util.regex.Pattern MATCH_JAVADOC_NOARG_MULTILINE_START
Compiled regexp to match first part of multilineJavadoc tags.
-
MATCH_JAVADOC_NOARG_CURLY
private static final java.util.regex.Pattern MATCH_JAVADOC_NOARG_CURLY
Compiled regexp to match Javadoc tags with no argument and {}.
-
DEFAULT_MIN_LINE_COUNT
private static final int DEFAULT_MIN_LINE_COUNT
Default value of minimal amount of lines in method to demand documentation presence.- See Also:
- Constant Field Values
-
scope
private Scope scope
The visibility scope where Javadoc comments are checked.
-
excludeScope
private Scope excludeScope
The visibility scope where Javadoc comments shouldn't be checked.
-
minLineCount
private int minLineCount
Minimal amount of lines in method to demand documentation presence.
-
allowUndeclaredRTE
private boolean allowUndeclaredRTE
Controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.
-
validateThrows
private boolean validateThrows
Allows validating throws tags.
-
allowThrowsTagsForSubclasses
private boolean allowThrowsTagsForSubclasses
Controls whether to allow documented exceptions that are subclass of one of declared exception. Defaults to false (backward compatibility).
-
allowMissingParamTags
private boolean allowMissingParamTags
Controls whether to ignore errors when a method has parameters but does not have matching param tags in the javadoc. Defaults to false.
-
allowMissingThrowsTags
private boolean allowMissingThrowsTags
Controls whether to ignore errors when a method declares that it throws exceptions but does not have matching throws tags in the javadoc. Defaults to false.
-
allowMissingReturnTag
private boolean allowMissingReturnTag
Controls whether to ignore errors when a method returns non-void type but does not have a return tag in the javadoc. Defaults to false.
-
allowMissingJavadoc
private boolean allowMissingJavadoc
Controls whether to ignore errors when there is no javadoc. Defaults to false.
-
allowMissingPropertyJavadoc
private boolean allowMissingPropertyJavadoc
Controls whether to allow missing Javadoc on accessor methods for properties (setters and getters).
-
allowedAnnotations
private java.util.List<java.lang.String> allowedAnnotations
List of annotations that could allow missed documentation.
-
ignoreMethodNamesRegex
private java.util.regex.Pattern ignoreMethodNamesRegex
Method names that match this pattern do not require javadoc blocks.
-
-
Method Detail
-
setIgnoreMethodNamesRegex
public void setIgnoreMethodNamesRegex(java.util.regex.Pattern pattern)
Set regex for matching method names to ignore.- Parameters:
pattern
- a pattern.
-
setMinLineCount
public void setMinLineCount(int value)
Sets minimal amount of lines in method.- Parameters:
value
- user's value.
-
setValidateThrows
public void setValidateThrows(boolean value)
Allow validating throws tag.- Parameters:
value
- user's value.
-
setAllowedAnnotations
public void setAllowedAnnotations(java.lang.String... userAnnotations)
Sets list of annotations.- Parameters:
userAnnotations
- user's value.
-
setScope
public void setScope(Scope scope)
Set the scope.- Parameters:
scope
- a scope.
-
setExcludeScope
public void setExcludeScope(Scope excludeScope)
Set the excludeScope.- Parameters:
excludeScope
- a scope.
-
setAllowUndeclaredRTE
public void setAllowUndeclaredRTE(boolean flag)
Controls whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException.- Parameters:
flag
- aBoolean
value
-
setAllowThrowsTagsForSubclasses
public void setAllowThrowsTagsForSubclasses(boolean flag)
Controls whether to allow documented exception that are subclass of one of declared exceptions.- Parameters:
flag
- aBoolean
value
-
setAllowMissingParamTags
public void setAllowMissingParamTags(boolean flag)
Controls whether to allow a method which has parameters to omit matching param tags in the javadoc. Defaults to false.- Parameters:
flag
- aBoolean
value
-
setAllowMissingThrowsTags
public void setAllowMissingThrowsTags(boolean flag)
Controls whether to allow a method which declares that it throws exceptions to omit matching throws tags in the javadoc. Defaults to false.- Parameters:
flag
- aBoolean
value
-
setAllowMissingReturnTag
public void setAllowMissingReturnTag(boolean flag)
Controls whether to allow a method which returns non-void type to omit the return tag in the javadoc. Defaults to false.- Parameters:
flag
- aBoolean
value
-
setAllowMissingJavadoc
public void setAllowMissingJavadoc(boolean flag)
Controls whether to ignore errors when there is no javadoc. Defaults to false.- Parameters:
flag
- aBoolean
value
-
setAllowMissingPropertyJavadoc
public void setAllowMissingPropertyJavadoc(boolean flag)
Controls whether to ignore errors when there is no javadoc for a property accessor (setter/getter methods). Defaults to false.- Parameters:
flag
- aBoolean
value
-
getDefaultTokens
public int[] getDefaultTokens()
Description copied from class:AbstractCheck
Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.- Specified by:
getDefaultTokens
in classAbstractCheck
- Returns:
- the default tokens
- See Also:
TokenTypes
-
getAcceptableTokens
public int[] getAcceptableTokens()
Description copied from class:AbstractCheck
The configurable token set. Used to protect Checks against malicious users who specify an unacceptable token set in the configuration file. The default implementation returns the check's default tokens.- Specified by:
getAcceptableTokens
in classAbstractCheck
- Returns:
- the token set this check is designed for.
- See Also:
TokenTypes
-
isCommentNodesRequired
public boolean isCommentNodesRequired()
Description copied from class:AbstractCheck
Whether comment nodes are required or not.- Overrides:
isCommentNodesRequired
in classAbstractCheck
- Returns:
- false as a default value.
-
processAST
protected final void processAST(DetailAST ast)
Description copied from class:AbstractTypeAwareCheck
Called to process an AST when visiting it.- Specified by:
processAST
in classAbstractTypeAwareCheck
- Parameters:
ast
- the AST to process. Guaranteed to not be PACKAGE_DEF or IMPORT tokens.
-
hasAllowedAnnotations
private boolean hasAllowedAnnotations(DetailAST methodDef)
Some javadoc.- Parameters:
methodDef
- Some javadoc.- Returns:
- Some javadoc.
-
getMethodsNumberOfLine
private static int getMethodsNumberOfLine(DetailAST methodDef)
Some javadoc.- Parameters:
methodDef
- Some javadoc.- Returns:
- Some javadoc.
-
logLoadError
protected final void logLoadError(AbstractTypeAwareCheck.Token ident)
Description copied from class:AbstractTypeAwareCheck
Logs error if unable to load class information. Abstract, should be overridden in subclasses.- Specified by:
logLoadError
in classAbstractTypeAwareCheck
- Parameters:
ident
- class name for which we can no load class.
-
isMissingJavadocAllowed
protected boolean isMissingJavadocAllowed(DetailAST ast)
The JavadocMethodCheck is about to report a missing Javadoc. This hook can be used by derived classes to allow a missing javadoc in some situations. The default implementation checksallowMissingJavadoc
andallowMissingPropertyJavadoc
properties, do not forget to callsuper.isMissingJavadocAllowed(ast)
in case you want to keep this logic.- Parameters:
ast
- the tree node for the method or constructor.- Returns:
- True if this method or constructor doesn't need Javadoc.
-
isContentsAllowMissingJavadoc
private boolean isContentsAllowMissingJavadoc(DetailAST ast)
Checks if the Javadoc can be missing if the method or constructor is below the minimum line count or has a special annotation.- Parameters:
ast
- the tree node for the method or constructor.- Returns:
- True if this method or constructor doesn't need Javadoc.
-
matchesSkipRegex
private boolean matchesSkipRegex(DetailAST methodDef)
Checks if the given method name matches the regex. In that case we skip enforcement of javadoc for this method- Parameters:
methodDef
-METHOD_DEF
- Returns:
- true if given method name matches the regex.
-
shouldCheck
private boolean shouldCheck(DetailAST ast, Scope nodeScope)
Whether we should check this node.- Parameters:
ast
- a given node.nodeScope
- the scope of the node.- Returns:
- whether we should check a given node.
-
checkComment
private void checkComment(DetailAST ast, TextBlock comment)
Checks the Javadoc for a method.- Parameters:
ast
- the token for the methodcomment
- the Javadoc comment
-
hasShortCircuitTag
private boolean hasShortCircuitTag(DetailAST ast, java.util.List<JavadocTag> tags)
Validates whether the Javadoc has a short circuit tag. Currently this is the inheritTag. Any errors are logged.- Parameters:
ast
- the construct being checkedtags
- the list of Javadoc tags associated with the construct- Returns:
- true if the construct has a short circuit tag.
-
calculateScope
private static Scope calculateScope(DetailAST ast)
Returns the scope for the method/constructor at the specified AST. If the method is in an interface or annotation block, the scope is assumed to be public.- Parameters:
ast
- the token of the method/constructor- Returns:
- the scope of the method/constructor
-
getMethodTags
private static java.util.List<JavadocTag> getMethodTags(TextBlock comment)
Returns the tags in a javadoc comment. Only finds throws, exception, param, return and see tags.- Parameters:
comment
- the Javadoc comment- Returns:
- the tags found
-
calculateTagColumn
private static int calculateTagColumn(java.util.regex.Matcher javadocTagMatcher, int lineNumber, int startColumnNumber)
Calculates column number using Javadoc tag matcher.- Parameters:
javadocTagMatcher
- found javadoc tag matcherlineNumber
- line number of Javadoc tag in commentstartColumnNumber
- column number of Javadoc comment beginning- Returns:
- column number
-
getMultilineArgTags
private static java.util.List<JavadocTag> getMultilineArgTags(java.util.regex.Matcher argMultilineStart, int column, java.lang.String[] lines, int lineIndex, int tagLine)
Gets multiline Javadoc tags with arguments.- Parameters:
argMultilineStart
- javadoc tag Matchercolumn
- column number of Javadoc taglines
- comment text lineslineIndex
- line number that contains the javadoc tagtagLine
- javadoc tag line number in file- Returns:
- javadoc tags with arguments
-
getMultilineNoArgTags
private static java.util.List<JavadocTag> getMultilineNoArgTags(java.util.regex.Matcher noargMultilineStart, java.lang.String[] lines, int lineIndex, int tagLine)
Gets multiline Javadoc tags with no arguments.- Parameters:
noargMultilineStart
- javadoc tag Matcherlines
- comment text lineslineIndex
- line number that contains the javadoc tagtagLine
- javadoc tag line number in file- Returns:
- javadoc tags with no arguments
-
getParameters
private static java.util.List<DetailAST> getParameters(DetailAST ast)
Computes the parameter nodes for a method.- Parameters:
ast
- the method node.- Returns:
- the list of parameter nodes for ast.
-
getThrows
private java.util.List<JavadocMethodCheck.ExceptionInfo> getThrows(DetailAST ast)
Computes the exception nodes for a method.- Parameters:
ast
- the method node.- Returns:
- the list of exception nodes for ast.
-
checkParamTags
private void checkParamTags(java.util.List<JavadocTag> tags, DetailAST parent, boolean reportExpectedTags)
Checks a set of tags for matching parameters.- Parameters:
tags
- the tags to checkparent
- the node which takes the parametersreportExpectedTags
- whether we should report if do not find expected tag
-
searchMatchingTypeParameter
private static boolean searchMatchingTypeParameter(java.util.List<DetailAST> typeParams, java.lang.String requiredTypeName)
Returns true if required type found in type parameters.- Parameters:
typeParams
- list of type parametersrequiredTypeName
- name of required type- Returns:
- true if required type found in type parameters.
-
removeMatchingParam
private static boolean removeMatchingParam(java.util.List<DetailAST> params, java.lang.String paramName)
Remove parameter from params collection by name.- Parameters:
params
- collection of DetailAST parametersparamName
- name of parameter- Returns:
- true if parameter found and removed
-
checkReturnTag
private void checkReturnTag(java.util.List<JavadocTag> tags, int lineNo, boolean reportExpectedTags)
Checks for only one return tag. All return tags will be removed from the supplied list.- Parameters:
tags
- the tags to checklineNo
- the line number of the expected tagreportExpectedTags
- whether we should report if do not find expected tag
-
checkThrowsTags
private void checkThrowsTags(java.util.List<JavadocTag> tags, java.util.List<JavadocMethodCheck.ExceptionInfo> throwsList, boolean reportExpectedTags)
Checks a set of tags for matching throws.- Parameters:
tags
- the tags to checkthrowsList
- the throws to checkreportExpectedTags
- whether we should report if do not find expected tag
-
isInThrows
private boolean isInThrows(java.util.List<JavadocMethodCheck.ExceptionInfo> throwsList, AbstractTypeAwareCheck.AbstractClassInfo documentedClassInfo, java.util.Set<java.lang.String> foundThrows)
Verifies that documented exception is in throws.- Parameters:
throwsList
- list of throwsdocumentedClassInfo
- documented exception class infofoundThrows
- previously found throws- Returns:
- true if documented exception is in throws.
-
-