public abstract class AbstractMethodOverrideCheck extends AbstractClassCheck
ClassCheck
implementations that check overridden methods.Modifier and Type | Field and Description |
---|---|
protected ConstraintHelper |
constraintHelper |
Constructor and Description |
---|
AbstractMethodOverrideCheck(Elements elementUtils,
Types typeUtils,
ConstraintHelper constraintHelper) |
Modifier and Type | Method and Description |
---|---|
Set<ConstraintCheckIssue> |
checkMethod(ExecutableElement currentMethod)
Checks whether the given method is written correctly.
|
protected abstract Set<ConstraintCheckIssue> |
checkMethodInternal(ExecutableElement currentMethod,
MethodInheritanceTree overriddenMethodsTree)
Performs the check of a method.
|
protected String |
getEnclosingTypeElementQualifiedName(ExecutableElement currentMethod)
Find a
String representation of qualified name (Name ) of corresponding TypeElement that
contains a given ExecutableElement . |
protected abstract boolean |
needToPerformAnyChecks(ExecutableElement currentMethod)
There can be situations in which no checks should be performed.
|
execute
protected ConstraintHelper constraintHelper
public AbstractMethodOverrideCheck(Elements elementUtils, Types typeUtils, ConstraintHelper constraintHelper)
public Set<ConstraintCheckIssue> checkMethod(ExecutableElement currentMethod)
ClassCheck
checkMethod
in interface ClassCheck
checkMethod
in class AbstractClassCheck
currentMethod
- the method under investigationprotected abstract Set<ConstraintCheckIssue> checkMethodInternal(ExecutableElement currentMethod, MethodInheritanceTree overriddenMethodsTree)
currentMethod
- a method to checkoverriddenMethodsTree
- the MethodInheritanceTree
of the method to checkprotected abstract boolean needToPerformAnyChecks(ExecutableElement currentMethod)
currentMethod
- the method under investigationtrue
if we should proceed with checks and false
otherwiseprotected String getEnclosingTypeElementQualifiedName(ExecutableElement currentMethod)
String
representation of qualified name (Name
) of corresponding TypeElement
that
contains a given ExecutableElement
.currentMethod
- a methodString
to which a method belongs toCopyright © 2007-2021 Red Hat, Inc. All Rights Reserved