org.apache.bval
Class MetaBeanManager

java.lang.Object
  extended by org.apache.bval.MetaBeanManager
All Implemented Interfaces:
MetaBeanFinder
Direct Known Subclasses:
XMLMetaBeanManager

public class MetaBeanManager
extends Object
implements MetaBeanFinder

Description: Default implementation for the interface to find, register and create MetaBeans. In most situations a single instance of this class is sufficient and you can get this instance from the MetaBeanManagerFactory.


Field Summary
protected  MetaBeanBuilder builder
          MetaBean builder
protected  MetaBeanCache cache
          MetaBean cache
protected  boolean complete
          Complete flag
 
Constructor Summary
MetaBeanManager()
          Create a new MetaBeanManager instance.
MetaBeanManager(MetaBeanBuilder builder)
          Create a new MetaBeanManager instance.
 
Method Summary
protected  void computeRelatedMetaBean(MetaProperty prop, String beanRef)
          Compute a single related MetaBean.
protected  void computeRelationships(MetaBean beanInfo)
          Compute all known relationships for beanInfo.
 MetaBean findForClass(Class<?> clazz)
          Find the MetaBean for the specified class.
 MetaBean findForId(String beanInfoId)
          Find a MetaBean with a certain id.
 MetaBeanBuilder getBuilder()
          Get the builder used.
 MetaBeanCache getCache()
          Get the cache used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected final MetaBeanCache cache
MetaBean cache


builder

protected final MetaBeanBuilder builder
MetaBean builder


complete

protected boolean complete
Complete flag

Constructor Detail

MetaBeanManager

public MetaBeanManager()
Create a new MetaBeanManager instance.


MetaBeanManager

public MetaBeanManager(MetaBeanBuilder builder)
Create a new MetaBeanManager instance.

Parameters:
builder -
Method Detail

getBuilder

public MetaBeanBuilder getBuilder()
Get the builder used.

Returns:
MetaBeanBuilder

getCache

public MetaBeanCache getCache()
Get the cache used.

Returns:
MetaBeanCache

findForId

public MetaBean findForId(String beanInfoId)
Find a MetaBean with a certain id.

Specified by:
findForId in interface MetaBeanFinder
Parameters:
beanInfoId - - symbolic unique name of Meta Info
Returns:
BeanInfo

findForClass

public MetaBean findForClass(Class<?> clazz)
Find the MetaBean for the specified class.

Specified by:
findForClass in interface MetaBeanFinder
Parameters:
clazz - - bean class
Returns:
BeanInfo (never null)

computeRelationships

protected void computeRelationships(MetaBean beanInfo)
Compute all known relationships for beanInfo. must be called AFTER cache.cache() to avoid endless loop

Parameters:
beanInfo - - the bean for which to compute relationships

computeRelatedMetaBean

protected void computeRelatedMetaBean(MetaProperty prop,
                                      String beanRef)
Compute a single related MetaBean.

Parameters:
prop -
beanRef -


Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.