org.hibernate.validator.internal.engine

## Class ValidationContext<T>

- java.lang.Object
- - org.hibernate.validator.internal.engine.ValidationContext<T>

-     public class ValidationContext<T>
      extends Object

  Context object keeping track of all required data for a validation call. We use this object to collect all failing constraints, but also to have access to resources like constraint validator factory, message interpolator, traversable resolver, etc.
  Author:
    Hardy Ferentschik, Emmanuel Bernard, Gunnar Morling

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ValidationContext.ValidationContextBuilder` Builder for creating `ValidationContext`s suited for the different kinds of validation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConstraintFailures(Set<ConstraintViolation<T>> failingConstraintViolations)`
    `ConstraintViolation<T>` | `createConstraintViolation(ValueContext<?,?> localContext, ConstraintViolationCreationContext constraintViolationCreationContext, ConstraintDescriptor<?> descriptor)`
    `Set<ConstraintViolation<T>>` | `createConstraintViolations(ValueContext<?,?> localContext, ConstraintValidatorContextImpl constraintValidatorContext)`
    `ConstraintValidatorFactory` | `getConstraintValidatorFactory()`
    `ConstraintValidatorManager` | `getConstraintValidatorManager()`
    `ExecutableElement` | `getExecutable()`
    `Set<ConstraintViolation<T>>` | `getFailingConstraints()`
    `List<String>` | `getParameterNames()` Returns a list with the current executable's parameter names as retrieved from the current `ParameterNameProvider`.
    `T` | `getRootBean()`
    `Class<T>` | `getRootBeanClass()`
    `TraversableResolver` | `getTraversableResolver()`
    `static ValidationContext.ValidationContextBuilder` | `getValidationContext(ConstraintValidatorManager constraintValidatorManager, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)`
    `boolean` | `hasMetaConstraintBeenProcessed(Object bean, Path path, MetaConstraint<?> metaConstraint)`
    `boolean` | `isBeanAlreadyValidated(Object value, Class<?> group, PathImpl path)`
    `boolean` | `isFailFastModeEnabled()`
    `void` | `markConstraintProcessed(Object bean, Path path, MetaConstraint<?> metaConstraint)`
    `void` | `markCurrentBeanAsProcessed(ValueContext<?,?> valueContext)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getValidationContext

          public static ValidationContext.ValidationContextBuilder getValidationContext(ConstraintValidatorManager constraintValidatorManager,
                                                                        MessageInterpolator messageInterpolator,
                                                                        ConstraintValidatorFactory constraintValidatorFactory,
                                                                        TraversableResolver traversableResolver,
                                                                        boolean failFast)

    - #### getRootBean

          public T getRootBean()

    - #### getRootBeanClass

          public Class<T> getRootBeanClass()

    - #### getExecutable

          public ExecutableElement getExecutable()

    - #### getTraversableResolver

          public TraversableResolver getTraversableResolver()

    - #### isFailFastModeEnabled

          public boolean isFailFastModeEnabled()

    - #### getConstraintValidatorManager

          public ConstraintValidatorManager getConstraintValidatorManager()

    - #### getParameterNames

          public List<String> getParameterNames()

      Returns a list with the current executable's parameter names as retrieved from the current `ParameterNameProvider`.
      Returns:
        The current executable's parameter names,if this context was created for parameter validation, `null` otherwise.

    - #### createConstraintViolations

          public Set<ConstraintViolation<T>> createConstraintViolations(ValueContext<?,?> localContext,
                                                               ConstraintValidatorContextImpl constraintValidatorContext)

    - #### getConstraintValidatorFactory

          public ConstraintValidatorFactory getConstraintValidatorFactory()

    - #### isBeanAlreadyValidated

          public boolean isBeanAlreadyValidated(Object value,
                                       Class<?> group,
                                       PathImpl path)

    - #### markCurrentBeanAsProcessed

          public void markCurrentBeanAsProcessed(ValueContext<?,?> valueContext)

    - #### addConstraintFailures

          public void addConstraintFailures(Set<ConstraintViolation<T>> failingConstraintViolations)

    - #### getFailingConstraints

          public Set<ConstraintViolation<T>> getFailingConstraints()

    - #### createConstraintViolation

          public ConstraintViolation<T> createConstraintViolation(ValueContext<?,?> localContext,
                                                         ConstraintViolationCreationContext constraintViolationCreationContext,
                                                         ConstraintDescriptor<?> descriptor)

    - #### hasMetaConstraintBeenProcessed

          public boolean hasMetaConstraintBeenProcessed(Object bean,
                                               Path path,
                                               MetaConstraint<?> metaConstraint)

    - #### markConstraintProcessed

          public void markConstraintProcessed(Object bean,
                                     Path path,
                                     MetaConstraint<?> metaConstraint)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved