org.hibernate.validator.internal.metadata

## Class BeanMetaDataManager

- java.lang.Object
- - 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

    Constructors
    Constructor and Description
    `BeanMetaDataManager(ConstraintHelper constraintHelper, ExecutableHelper executableHelper)` Creates a new `BeanMetaDataManager`.
    `BeanMetaDataManager(ConstraintHelper constraintHelper, ExecutableHelper executableHelper, ParameterNameProvider parameterNameProvider, List<MetaDataProvider> optionalMetaDataProviders)` Creates a new `BeanMetaDataManager`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `<T> BeanMetaData<T>` | `getBeanMetaData(Class<T> beanClass)`
    `boolean` | `isConstrained(Class<?> 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,
                             ExecutableHelper executableHelper)

      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
        `executableHelper` - the executable helper

    - #### BeanMetaDataManager

          public BeanMetaDataManager(ConstraintHelper constraintHelper,
                             ExecutableHelper executableHelper,
                             ParameterNameProvider parameterNameProvider,
                             List<MetaDataProvider> optionalMetaDataProviders)

      Creates a new `BeanMetaDataManager`.
      Parameters:
        `constraintHelper` - the constraint helper
        `executableHelper` - the executable helper
        `parameterNameProvider` - the parameter name provider
        `optionalMetaDataProviders` - optional meta data provider used on top of the annotation based provider

  - ### Method Detail

    - #### isConstrained

          public boolean isConstrained(Class<?> beanClass)

    - #### getBeanMetaData

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

    - #### clear

          public void clear()

    - #### numberOfCachedBeanMetaDataInstances

          public int numberOfCachedBeanMetaDataInstances()

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