Top Description Inners Fields Constructors Methods
org.hibernate.validator.internal.metadata.core

public Class MetaConstraint<A extends java.lang.annotation.Annotation>

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Type, .TypeVariable, java.util.List, .NoSuchElementException, .Set, jakarta.validation.valueextraction.ValueExtractor, org.hibernate.validator.internal.engine.valuecontext.ValueContext, .BeanValueContext, org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree, .ConstraintValidatorManager, org.hibernate.validator.internal.engine.validationcontext.ValidationContext, org.hibernate.validator.internal.engine.valueextraction.ValueExtractorDescriptor, .ValueExtractorHelper, org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl, org.hibernate.validator.internal.metadata.location.ConstraintLocation, .ConstraintLocation.ConstraintLocationKind, org.hibernate.validator.internal.util.StringHelper, org.hibernate.validator.internal.util.stereotypes.Immutable

Instances of this class abstract the constraint type (class, method or field constraint) and give access to meta data about the constraint. This allows a unified handling of constraints in the validator implementation.
Authors
Hardy Ferentschik, Gunnar Morling, Guillaume Smet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class
private static class
private class
private static interface

Field Summary

Modifier and TypeField and Description
private final ConstraintTree<A>
constraintTree

The constraint tree created from the constraint annotation.

private final int
private final boolean
isDefinedForOneGroupOnly

Indicates if the constraint is defined for one group only: used to optimize already validated constraints tracking.

private final ConstraintLocation
location

The location at which this constraint is defined.

private final MetaConstraint.ValueExtractionPathNode
valueExtractionPath

The path used to navigate from the outermost container to the innermost container and extract the value for validation.

Constructor Summary

AccessConstructor and Description
pack-priv
MetaConstraint(ConstraintValidatorManager constraintValidatorManager, ConstraintDescriptorImpl<A>
The constraint descriptor for this constraint
constraintDescriptor
,
ConstraintLocation
meta data about constraint placement
location
,
List<MetaConstraint.ContainerClassTypeParameterAndExtractor>
the potential ValueExtractors used to extract the value to validate
valueExtractionPath
,
Type
the type of the validated element
validatedValueType
)

Method Summary

Modifier and TypeMethod and Description
private static int
buildHashCode(ConstraintDescriptorImpl<?> constraintDescriptor, ConstraintLocation location)

private boolean
doValidateConstraint(ValidationContext<?> executionContext, ValueContext<?, ?> valueContext)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public final ConstraintLocation.ConstraintLocationKind
public final ConstraintDescriptorImpl<A>
public final Set<Class<?>>

Returns:

Returns the list of groups this constraint is part of. This might include the default group even when it is not explicitly specified, but part of the redefined default group list of the hosting bean.
getGroupList
()

public ConstraintLocation
private static MetaConstraint.ValueExtractionPathNode
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public final boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public boolean
validateConstraint(ValidationContext<?> validationContext, ValueContext<?, Object> valueContext)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait