org.hibernate.validator.internal.metadata
Class BeanMetaDataManager

java.lang.Object
  extended by org.hibernate.validator.internal.metadata.BeanMetaDataManager

public class BeanMetaDataManager
extends Object

This manager is in charge of providing all constraint related meta data required by the validation engine.

Actual retrieval of meta data is delegated to MetaDataProvider implementations which load meta-data based e.g. based on annotations or XML.

For performance reasons a cache is used which stores all meta data once loaded for repeated retrieval. Upon initialization this cache is populated with meta data provided by the given eager providers. If the cache doesn't contain the meta data for a requested type it will be retrieved on demand using the annotation based provider.

Author:
Gunnar Morling

Constructor Summary
BeanMetaDataManager(ConstraintHelper constraintHelper)
          Creates a new BeanMetaDataManager.
BeanMetaDataManager(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider, List<MetaDataProvider> optionalMetaDataProviders)
          Creates a new BeanMetaDataManager.
 
Method Summary
 void clear()
           
<T> BeanMetaData<T>
getBeanMetaData(Class<T> beanClass)
           
 int numberOfCachedBeanMetaDataInstances()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanMetaDataManager

public BeanMetaDataManager(ConstraintHelper constraintHelper)
Creates a new BeanMetaDataManager. DefaultParameterNameProvider is used as parameter name provider, no meta data providers besides the annotation-based providers are used.

Parameters:
constraintHelper - The constraint helper

BeanMetaDataManager

public BeanMetaDataManager(ConstraintHelper constraintHelper,
                           ParameterNameProvider parameterNameProvider,
                           List<MetaDataProvider> optionalMetaDataProviders)
Creates a new BeanMetaDataManager.

Parameters:
constraintHelper - the constraint helper
parameterNameProvider - the parameter name provider
optionalMetaDataProviders - optional meta data provider used on top of the annotation based provider
Method Detail

getBeanMetaData

public <T> BeanMetaData<T> getBeanMetaData(Class<T> beanClass)

clear

public void clear()

numberOfCachedBeanMetaDataInstances

public int numberOfCachedBeanMetaDataInstances()


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