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(javax.lang.model.util.Elements elementUtils,
javax.lang.model.util.Types typeUtils,
ConstraintHelper constraintHelper) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<ConstraintCheckIssue> |
checkMethod(javax.lang.model.element.ExecutableElement currentMethod)
Checks whether the given method is written correctly.
|
protected abstract java.util.Set<ConstraintCheckIssue> |
checkMethodInternal(javax.lang.model.element.ExecutableElement currentMethod,
MethodInheritanceTree overriddenMethodsTree)
Performs the check of a method.
|
protected java.lang.String |
getEnclosingTypeElementQualifiedName(javax.lang.model.element.ExecutableElement currentMethod)
Find a
String representation of qualified name (Name ) of corresponding TypeElement that
contains a given ExecutableElement . |
protected abstract boolean |
needToPerformAnyChecks(javax.lang.model.element.ExecutableElement currentMethod)
There can be situations in which no checks should be performed.
|
execute
protected ConstraintHelper constraintHelper
public AbstractMethodOverrideCheck(javax.lang.model.util.Elements elementUtils, javax.lang.model.util.Types typeUtils, ConstraintHelper constraintHelper)
public java.util.Set<ConstraintCheckIssue> checkMethod(javax.lang.model.element.ExecutableElement currentMethod)
ClassCheck
checkMethod
in interface ClassCheck
checkMethod
in class AbstractClassCheck
currentMethod
- the method under investigationprotected abstract java.util.Set<ConstraintCheckIssue> checkMethodInternal(javax.lang.model.element.ExecutableElement currentMethod, MethodInheritanceTree overriddenMethodsTree)
currentMethod
- a method to checkoverriddenMethodsTree
- the MethodInheritanceTree
of the method to checkprotected abstract boolean needToPerformAnyChecks(javax.lang.model.element.ExecutableElement currentMethod)
currentMethod
- the method under investigationtrue
if we should proceed with checks and false
otherwiseprotected java.lang.String getEnclosingTypeElementQualifiedName(javax.lang.model.element.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-2022 Red Hat, Inc. All Rights Reserved