Class MethodConfigurationRule
java.lang.Object
org.hibernate.validator.internal.metadata.aggregated.rule.MethodConfigurationRule
- Direct Known Subclasses:
OverridingMethodMustNotAlterParameterConstraints,ParallelMethodsMustNotDefineGroupConversionForCascadedReturnValue,ParallelMethodsMustNotDefineParameterConstraints,ReturnValueMayOnlyBeMarkedOnceAsCascadedPerHierarchyLine,VoidMethodsMustNotBeReturnValueConstrained
A rule applying to the overriding methods of an inheritance hierarchy.
- Author:
- Gunnar Morling
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidapply(ConstrainedExecutable method, ConstrainedExecutable otherMethod) Applies this rule.protected booleanisDefinedOnParallelType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutableis defined on a parallel of the declaring type ofexecutableor not.protected booleanisDefinedOnSubType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutableis defined on a subtype of the declaring type ofexecutableor not.protected booleanisStrictSubType(Class<?> clazz, Class<?> otherClazz) WhetherotherClazzis a strict subtype ofclazzor not.
-
Field Details
-
LOG
-
-
Constructor Details
-
MethodConfigurationRule
public MethodConfigurationRule()
-
-
Method Details
-
apply
Applies this rule. Invoked for each pair of methods collected by a given executable meta dataExecutableMetaData.Builder.- Parameters:
method- The first method to check.otherMethod- The other method to check.- Throws:
ConstraintDeclarationException- If this rule is violated by the two given methods.
-
isStrictSubType
WhetherotherClazzis a strict subtype ofclazzor not.- Parameters:
clazz- the super type to check againstotherClazz- the subtype to check- Returns:
trueifotherClazzis a strict subtype ofclazz,falseotherwise
-
isDefinedOnSubType
protected boolean isDefinedOnSubType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutableis defined on a subtype of the declaring type ofexecutableor not.- Parameters:
executable- the executable to check againstotherExecutable- the executable to check- Returns:
trueifotherExecutableis defined on a subtype of the declaring type ofotherExecutable,falseotherwise
-
isDefinedOnParallelType
protected boolean isDefinedOnParallelType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutableis defined on a parallel of the declaring type ofexecutableor not.- Parameters:
executable- the executable to check againstotherExecutable- the executable to check- Returns:
trueifotherExecutableis defined on a parallel of the declaring type ofotherExecutable,falseotherwise
-