org.apache.bval.jsr303
Class ApacheFactoryContext

java.lang.Object
  extended by org.apache.bval.jsr303.ApacheFactoryContext
All Implemented Interfaces:
ValidatorContext

public class ApacheFactoryContext
extends Object
implements ValidatorContext

Description: Represents the context that is used to create ClassValidator instances.


Constructor Summary
  ApacheFactoryContext(ApacheValidatorFactory factory)
          Create a new ApacheFactoryContext instance.
protected ApacheFactoryContext(ApacheValidatorFactory factory, MetaBeanFinder metaBeanFinder)
          Create a new ApacheFactoryContext instance.
 
Method Summary
protected  MetaBeanFinder buildMetaBeanFinder()
          Create MetaBeanManager that uses factories: if enabled by ApacheValidatorConfiguration.Properties.ENABLE_INTROSPECTOR, an IntrospectorMetaBeanFactory MetaBeanFactory types (if any) specified by ApacheValidatorConfiguration.Properties.METABEAN_FACTORY_CLASSNAMES if no Jsr303MetaBeanFactory has yet been specified (this allows factory order customization), a Jsr303MetaBeanFactory which handles both JSR303-XML and JSR303-Annotations if enabled by ApacheValidatorConfiguration.Properties.ENABLE_METABEANS_XML, an XMLMetaBeanFactory
 ValidatorContext constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)
          
protected  MetaBeanFinder createMetaBeanManager(List<MetaBeanFactory> builders)
          Create a MetaBeanManager using the specified builders.
 ConstraintValidatorFactory getConstraintValidatorFactory()
          Get the ConstraintValidatorFactory.
 ApacheValidatorFactory getFactory()
          Get the ApacheValidatorFactory used by this ApacheFactoryContext.
 MessageInterpolator getMessageInterpolator()
          Get the MessageInterpolator.
 MetaBeanFinder getMetaBeanFinder()
          Get the metaBeanFinder.
 TraversableResolver getTraversableResolver()
          Get the TraversableResolver.
 Validator getValidator()
          
 ValidatorContext messageInterpolator(MessageInterpolator messageInterpolator)
          
 ValidatorContext traversableResolver(TraversableResolver traversableResolver)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApacheFactoryContext

public ApacheFactoryContext(ApacheValidatorFactory factory)
Create a new ApacheFactoryContext instance.

Parameters:
factory -

ApacheFactoryContext

protected ApacheFactoryContext(ApacheValidatorFactory factory,
                               MetaBeanFinder metaBeanFinder)
Create a new ApacheFactoryContext instance.

Parameters:
factory -
metaBeanFinder -
Method Detail

getFactory

public ApacheValidatorFactory getFactory()
Get the ApacheValidatorFactory used by this ApacheFactoryContext.

Returns:
ApacheValidatorFactory

getMetaBeanFinder

public final MetaBeanFinder getMetaBeanFinder()
Get the metaBeanFinder.

Returns:
MetaBeanFinder

messageInterpolator

public ValidatorContext messageInterpolator(MessageInterpolator messageInterpolator)

Specified by:
messageInterpolator in interface ValidatorContext

traversableResolver

public ValidatorContext traversableResolver(TraversableResolver traversableResolver)

Specified by:
traversableResolver in interface ValidatorContext

constraintValidatorFactory

public ValidatorContext constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)

Specified by:
constraintValidatorFactory in interface ValidatorContext

getConstraintValidatorFactory

public ConstraintValidatorFactory getConstraintValidatorFactory()
Get the ConstraintValidatorFactory.

Returns:
ConstraintValidatorFactory

getValidator

public Validator getValidator()

Specified by:
getValidator in interface ValidatorContext

getMessageInterpolator

public MessageInterpolator getMessageInterpolator()
Get the MessageInterpolator.

Returns:
MessageInterpolator

getTraversableResolver

public TraversableResolver getTraversableResolver()
Get the TraversableResolver.

Returns:
TraversableResolver

buildMetaBeanFinder

protected MetaBeanFinder buildMetaBeanFinder()
Create MetaBeanManager that uses factories:
  1. if enabled by ApacheValidatorConfiguration.Properties.ENABLE_INTROSPECTOR, an IntrospectorMetaBeanFactory
  2. MetaBeanFactory types (if any) specified by ApacheValidatorConfiguration.Properties.METABEAN_FACTORY_CLASSNAMES
  3. if no Jsr303MetaBeanFactory has yet been specified (this allows factory order customization), a Jsr303MetaBeanFactory which handles both JSR303-XML and JSR303-Annotations
  4. if enabled by ApacheValidatorConfiguration.Properties.ENABLE_METABEANS_XML, an XMLMetaBeanFactory

Returns:
a new instance of MetaBeanManager with adequate MetaBeanFactories

createMetaBeanManager

protected MetaBeanFinder createMetaBeanManager(List<MetaBeanFactory> builders)
Create a MetaBeanManager using the specified builders.

Parameters:
builders - MetaBeanFactory List
Returns:
MetaBeanManager


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.