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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
apply
(ConstrainedExecutable method, ConstrainedExecutable otherMethod) Applies this rule.protected boolean
isDefinedOnParallelType
(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutable
is defined on a parallel of the declaring type ofexecutable
or not.protected boolean
isDefinedOnSubType
(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutable
is defined on a subtype of the declaring type ofexecutable
or not.protected boolean
isStrictSubType
(Class<?> clazz, Class<?> otherClazz) WhetherotherClazz
is a strict subtype ofclazz
or 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
WhetherotherClazz
is a strict subtype ofclazz
or not.- Parameters:
clazz
- the super type to check againstotherClazz
- the subtype to check- Returns:
true
ifotherClazz
is a strict subtype ofclazz
,false
otherwise
-
isDefinedOnSubType
protected boolean isDefinedOnSubType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutable
is defined on a subtype of the declaring type ofexecutable
or not.- Parameters:
executable
- the executable to check againstotherExecutable
- the executable to check- Returns:
true
ifotherExecutable
is defined on a subtype of the declaring type ofotherExecutable
,false
otherwise
-
isDefinedOnParallelType
protected boolean isDefinedOnParallelType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable) WhetherotherExecutable
is defined on a parallel of the declaring type ofexecutable
or not.- Parameters:
executable
- the executable to check againstotherExecutable
- the executable to check- Returns:
true
ifotherExecutable
is defined on a parallel of the declaring type ofotherExecutable
,false
otherwise
-