Class MethodConfigurationRule
- java.lang.Object
-
- org.hibernate.validator.internal.metadata.aggregated.rule.MethodConfigurationRule
-
- Direct Known Subclasses:
OverridingMethodMustNotAlterParameterConstraints,ParallelMethodsMustNotDefineGroupConversionForCascadedReturnValue,ParallelMethodsMustNotDefineParameterConstraints,ReturnValueMayOnlyBeMarkedOnceAsCascadedPerHierarchyLine,VoidMethodsMustNotBeReturnValueConstrained
public abstract class MethodConfigurationRule extends Object
A rule applying to the overriding methods of an inheritance hierarchy.- Author:
- Gunnar Morling
-
-
Constructor Summary
Constructors Constructor Description MethodConfigurationRule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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 Detail
-
LOG
protected static final Log LOG
-
-
Method Detail
-
apply
public abstract void apply(ConstrainedExecutable method, ConstrainedExecutable otherMethod)
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
protected boolean isStrictSubType(Class<?> clazz, Class<?> otherClazz)
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
-
-