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
  • Field Details

    • LOG

      protected static final Log LOG
  • Constructor Details

    • MethodConfigurationRule

      public MethodConfigurationRule()
  • Method Details

    • apply

      public abstract void apply(ConstrainedExecutable method, ConstrainedExecutable otherMethod)
      Applies this rule. Invoked for each pair of methods collected by a given executable meta data ExecutableMetaData.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)
      Whether otherClazz is a strict subtype of clazz or not.
      Parameters:
      clazz - the super type to check against
      otherClazz - the subtype to check
      Returns:
      true if otherClazz is a strict subtype of clazz, false otherwise
    • isDefinedOnSubType

      protected boolean isDefinedOnSubType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable)
      Whether otherExecutable is defined on a subtype of the declaring type of executable or not.
      Parameters:
      executable - the executable to check against
      otherExecutable - the executable to check
      Returns:
      true if otherExecutable is defined on a subtype of the declaring type of otherExecutable, false otherwise
    • isDefinedOnParallelType

      protected boolean isDefinedOnParallelType(ConstrainedExecutable executable, ConstrainedExecutable otherExecutable)
      Whether otherExecutable is defined on a parallel of the declaring type of executable or not.
      Parameters:
      executable - the executable to check against
      otherExecutable - the executable to check
      Returns:
      true if otherExecutable is defined on a parallel of the declaring type of otherExecutable, false otherwise