org.apache.bval.xml
Class XMLMetaBeanManager

java.lang.Object
  extended by org.apache.bval.MetaBeanManager
      extended by org.apache.bval.xml.XMLMetaBeanManager
All Implemented Interfaces:
MetaBeanFinder, MetaBeanEnricher, XMLMetaBeanRegistry

public class XMLMetaBeanManager
extends MetaBeanManager
implements XMLMetaBeanRegistry, MetaBeanEnricher

Description: internal implementation class to construct metabeans with factories and from xstream xml files. You can register different XMLMetaBeanLoaders (see addLoader()) to register xstream-xml-files that contain meta-data. You can merge + unify meta data with method enrichCopies().
User: roman.stumm
Date: 17.06.2010
Time: 09:47:14


Field Summary
 
Fields inherited from class org.apache.bval.MetaBeanManager
builder, cache, complete
 
Constructor Summary
XMLMetaBeanManager()
           
XMLMetaBeanManager(XMLMetaBeanBuilder builder)
           
 
Method Summary
 void addLoader(XMLMetaBeanLoader loader)
          add a loader for xml bean infos.
 void addResourceLoader(String resource)
          convenience method to add a loader for a xml file in the classpath
protected  void computeRelatedMetaBean(MetaProperty prop, String beanRef)
          Compute a single related MetaBean.
protected  void computeRelationships(MetaBean beanInfo, Map<String,MetaBean> cached)
           
 Map<String,MetaBean> enrichCopies(XMLMetaBeanInfos... infos)
           
 Map<String,MetaBean> findAll()
           
 
Methods inherited from class org.apache.bval.MetaBeanManager
computeRelationships, findForClass, findForId, getBuilder, getCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMetaBeanManager

public XMLMetaBeanManager()

XMLMetaBeanManager

public XMLMetaBeanManager(XMLMetaBeanBuilder builder)
Method Detail

addResourceLoader

public void addResourceLoader(String resource)
Description copied from interface: XMLMetaBeanRegistry
convenience method to add a loader for a xml file in the classpath

Specified by:
addResourceLoader in interface XMLMetaBeanRegistry
Parameters:
resource - - path of xml file in classpath

addLoader

public void addLoader(XMLMetaBeanLoader loader)
Description copied from interface: XMLMetaBeanRegistry
add a loader for xml bean infos. the registry should use the loader in the sequence they have been added.

Specified by:
addLoader in interface XMLMetaBeanRegistry

enrichCopies

public Map<String,MetaBean> enrichCopies(XMLMetaBeanInfos... infos)
Specified by:
enrichCopies in interface MetaBeanEnricher
Parameters:
infos - - the patches to apply
Returns:
all MetaBeans for classes that have a xml descriptor and additional the MetaBeans loaded by the given loaders. The given loaders may also return patches for MetaBeans that have also been returned by other loaders. The beans with patches for references to patched beans will be copied.

findAll

public Map<String,MetaBean> findAll()
Returns:
all MetaBeans for classes that have a xml descriptor: key = bean.id, value = MetaBean

computeRelationships

protected void computeRelationships(MetaBean beanInfo,
                                    Map<String,MetaBean> cached)

computeRelatedMetaBean

protected void computeRelatedMetaBean(MetaProperty prop,
                                      String beanRef)
Description copied from class: MetaBeanManager
Compute a single related MetaBean.

Overrides:
computeRelatedMetaBean in class MetaBeanManager


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