javax.validation
Interface ValidatorFactory


public interface ValidatorFactory

Factory returning initialized Validator instances. Implementations are thread-safe This object is typically cached and reused.

Author:
Emmanuel Bernard

Method Summary
 MessageInterpolator getMessageInterpolator()
          Returns the MessageInterpolator instance configured at initialization time for the ValidatorFactory.
 Validator getValidator()
           
<T> T
unwrap(java.lang.Class<T> type)
          Return an object of the specified type to allow access to the provider-specific API.
 ValidatorContext usingContext()
          Define the validator context and return a Validator compliant with this state.
 

Method Detail

getValidator

Validator getValidator()
Returns:
Returns an initialized Validator instance using the default factory instances for message interpolator and traversable resolver.

Validator instances can be pooled and shared by the implementation.


usingContext

ValidatorContext usingContext()
Define the validator context and return a Validator compliant with this state.

Returns:
a ValidatorContext.

getMessageInterpolator

MessageInterpolator getMessageInterpolator()
Returns the MessageInterpolator instance configured at initialization time for the ValidatorFactory. This is the instance used by #getValidator().

Returns:
MessageInterpolator instance.

unwrap

<T> T unwrap(java.lang.Class<T> type)
Return an object of the specified type to allow access to the provider-specific API. If the Bean Validation provider implementation does not support the specified class, the ValidationException is thrown.

Parameters:
type - the class of the object to be returned.
Returns:
an instance of the specified class
Throws:
ValidationException - if the provider does not support the call.


Copyright © 2007-2009. All Rights Reserved.