public abstract class ValidationContext<T,C extends ConstraintViolation<T>> extends Object
Validator.validate(Object, Class[])
},
Validator.validateValue(Class, String, Object, Class[])
}
or Validator.validateProperty(Object, String, Class[])
call.
We use this object to collect all failing constraints, but also to cache the caching traversable resolver for a full stack call.
Modifier and Type | Field and Description |
---|---|
protected MessageInterpolator |
messageInterpolator
The message resolver which should be used in this context.
|
Modifier | Constructor and Description |
---|---|
protected |
ValidationContext(Class<T> rootBeanClass,
T rootBean,
MessageInterpolator messageInterpolator,
ConstraintValidatorFactory constraintValidatorFactory,
TraversableResolver traversableResolver,
boolean failFast) |
protected final MessageInterpolator messageInterpolator
protected ValidationContext(Class<T> rootBeanClass, T rootBean, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public static <T> ValidationContext<T,ConstraintViolation<T>> getContextForValidate(T object, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public static <T> ValidationContext<T,ConstraintViolation<T>> getContextForValidateProperty(T rootBean, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public static <T> ValidationContext<T,ConstraintViolation<T>> getContextForValidateValue(Class<T> rootBeanClass, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public static <T> MethodValidationContext<T> getContextForValidateParameter(Method method, int parameterIndex, T object, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public static <T> MethodValidationContext<T> getContextForValidateParameters(Method method, T object, MessageInterpolator messageInterpolator, ConstraintValidatorFactory constraintValidatorFactory, TraversableResolver traversableResolver, boolean failFast)
public final T getRootBean()
public final TraversableResolver getTraversableResolver()
public final boolean isFailFastModeEnabled()
public abstract <U,V> C createConstraintViolation(ValueContext<U,V> localContext, MessageAndPath messageAndPath, ConstraintDescriptor<?> descriptor)
public final <U,V> List<C> createConstraintViolations(ValueContext<U,V> localContext, ConstraintValidatorContextImpl constraintValidatorContext)
public final ConstraintValidatorFactory getConstraintValidatorFactory()
Copyright © 2018 JBoss by Red Hat. All rights reserved.