javax.validation
Interface ValidatorContext


public interface ValidatorContext

Represents the context that is used to create Validator instances. A client may use methods of the ValidatorContext returned by ValidatorFactory#usingContext to customize the context used to create Validator instances (for instance establish different message interpolators or traversable resolvers).

Author:
Emmanuel Bernard

Method Summary
 ValidatorContext constraintValidatorFactory(ConstraintValidatorFactory factory)
          Defines the constraint validator factory implementation used by the Validator.
 Validator getValidator()
           
 ValidatorContext messageInterpolator(MessageInterpolator messageInterpolator)
          Defines the message interpolator implementation used by the Validator.
 ValidatorContext traversableResolver(TraversableResolver traversableResolver)
          Defines the traversable resolver implementation used by the Validator.
 

Method Detail

messageInterpolator

ValidatorContext messageInterpolator(MessageInterpolator messageInterpolator)
Defines the message interpolator implementation used by the Validator. If not set or if null is passed as a parameter, the message interpolator of the ValidatorFactory is used.

Returns:
self following the chaining method pattern

traversableResolver

ValidatorContext traversableResolver(TraversableResolver traversableResolver)
Defines the traversable resolver implementation used by the Validator. If not set or if null is passed as a parameter, the traversable resolver of the ValidatorFactory is used.

Returns:
self following the chaining method pattern

constraintValidatorFactory

ValidatorContext constraintValidatorFactory(ConstraintValidatorFactory factory)
Defines the constraint validator factory implementation used by the Validator. If not set or if null is passed as a parameter, the constraint validator factory of the ValidatorFactory is used.

Returns:
self following the chaining method pattern

getValidator

Validator getValidator()
Returns:
an initialized Validator instance respecting the defined state. Validator instances can be pooled and shared by the implementation.


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41