Top Description Inners Fields Constructors Methods
org.hibernate.validator.internal.engine.valuecontext

public Class ValueContext<T, V>

extends Object
Class Inheritance
Known Direct Subclasses
org.hibernate.validator.internal.engine.valuecontext.BeanValueContext
Imports
java.lang.reflect.TypeVariable, jakarta.validation.groups.Default, org.hibernate.validator.internal.engine.path.PathImpl, org.hibernate.validator.internal.engine.valueextraction.AnnotatedObject, .ArrayElement, org.hibernate.validator.internal.metadata.facets.Cascadable, .Validatable, org.hibernate.validator.internal.metadata.location.ConstraintLocation, .ConstraintLocation.ConstraintLocationKind, org.hibernate.validator.internal.util.ExecutableParameterNameProvider, .TypeVariables

An instance of this class is used to collect all the relevant information for validating a single class, property or method invocation.
Authors
Hardy Ferentschik, Gunnar Morling, Guillaume Smet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private ConstraintLocation.ConstraintLocationKind
constraintLocationKind

The ConstraintLocationKind the constraint was defined on

private final T
currentBean

The current bean which gets validated.

private Class<?>
currentGroup

The current group we are validating.

private final Validatable
private V
currentValue

The value which gets currently evaluated.

private final ExecutableParameterNameProvider
private PathImpl
propertyPath

The current property path we are validating.

Constructor Summary

AccessConstructor and Description
pack-priv
ValueContext(ExecutableParameterNameProvider parameterNameProvider, T currentBean, Validatable validatable, PathImpl propertyPath)

Method Summary

Modifier and TypeMethod and Description
public final void
public final void
public final void
public final ConstraintLocation.ConstraintLocationKind
public final T
public final Class<?>
public Validatable
public final Object
getCurrentValidatedValue()

Returns the current value to be validated.

public final ValueContext.ValueState<V>
public final PathImpl
public Object
public final void
public final void
public final void
public final void
public final void
public final void
setCurrentGroup(Class<?> currentGroup)

public final void
setCurrentValidatedValue(V currentValue)

public final void
setTypeParameter(Class<?>
the class of the container
containerClass
,
Integer
the index of the actual type parameter
typeParameterIndex
)

Sets the container element information.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constraintLocationKindback to summary
private ConstraintLocation.ConstraintLocationKind constraintLocationKind

The ConstraintLocationKind the constraint was defined on

currentBeanback to summary
private final T currentBean

The current bean which gets validated. This is the bean hosting the constraints which get validated.

currentGroupback to summary
private Class<?> currentGroup

The current group we are validating.

currentValidatableback to summary
private final Validatable currentValidatable
currentValueback to summary
private V currentValue

The value which gets currently evaluated.

parameterNameProviderback to summary
private final ExecutableParameterNameProvider parameterNameProvider
propertyPathback to summary
private PathImpl propertyPath

The current property path we are validating.

Constructor Detail

ValueContextback to summary
pack-priv ValueContext(ExecutableParameterNameProvider parameterNameProvider, T currentBean, Validatable validatable, PathImpl propertyPath)

Method Detail

appendNodeback to summary
public final void appendNode(Cascadable node)
appendNodeback to summary
public final void appendNode(ConstraintLocation location)
appendTypeParameterNodeback to summary
public final void appendTypeParameterNode(String nodeName)
getConstraintLocationKindback to summary
public final ConstraintLocation.ConstraintLocationKind getConstraintLocationKind()
getCurrentBeanback to summary
public final T getCurrentBean()
getCurrentGroupback to summary
public final Class<?> getCurrentGroup()
getCurrentValidatableback to summary
public Validatable getCurrentValidatable()
getCurrentValidatedValueback to summary
public final Object getCurrentValidatedValue()

Returns the current value to be validated.

getCurrentValueStateback to summary
public final ValueContext.ValueState<V> getCurrentValueState()
getPropertyPathback to summary
public final PathImpl getPropertyPath()
getValueback to summary
public Object getValue(Object parent, ConstraintLocation location)
markCurrentPropertyAsIterableback to summary
public final void markCurrentPropertyAsIterable()
markCurrentPropertyAsIterableAndSetIndexback to summary
public final void markCurrentPropertyAsIterableAndSetIndex(Integer index)
markCurrentPropertyAsIterableAndSetKeyback to summary
public final void markCurrentPropertyAsIterableAndSetKey(Object key)
resetValueStateback to summary
public final void resetValueState(ValueContext.ValueState<V> valueState)
setConstraintLocationKindback to summary
public final void setConstraintLocationKind(ConstraintLocation.ConstraintLocationKind constraintLocationKind)
setCurrentGroupback to summary
public final void setCurrentGroup(Class<?> currentGroup)
setCurrentValidatedValueback to summary
public final void setCurrentValidatedValue(V currentValue)
setTypeParameterback to summary
public final void setTypeParameter(Class<?> containerClass, Integer typeParameterIndex)

Sets the container element information.

Parameters
containerClass:Class<?>

the class of the container

typeParameterIndex:Integer

the index of the actual type parameter

See Also
TypeVariables#getContainerClass(TypeVariable), TypeVariables#getActualTypeParameter(TypeVariable), AnnotatedObject, ArrayElement
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
validatingDefaultback to summary
public final boolean validatingDefault()
org.hibernate.validator.internal.engine.valuecontext back to summary

public Class ValueContext.ValueState<V>

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.validator.internal.engine.valuecontext.ValueContext.ValueState

Field Summary

Modifier and TypeField and Description
private final V
private final PathImpl

Constructor Summary

AccessConstructor and Description
pack-priv
ValueState(PathImpl propertyPath, V currentValue)

Method Summary

Modifier and TypeMethod and Description
public V
public PathImpl
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentValueback to summary
private final V currentValue
propertyPathback to summary
private final PathImpl propertyPath

Constructor Detail

ValueStateback to summary
pack-priv ValueState(PathImpl propertyPath, V currentValue)

Method Detail

getCurrentValueback to summary
public V getCurrentValue()
getPropertyPathback to summary
public PathImpl getPropertyPath()