Class IncludeListBeanFactory<T>

Object
org.apache.commons.configuration.beanutils.DefaultBeanFactory
AnchorBeanFactory
IncludeListBeanFactory<T>
Type Parameters:
T - list-item type
All Implemented Interfaces:
org.apache.commons.configuration.beanutils.BeanFactory

public class IncludeListBeanFactory<T> extends AnchorBeanFactory
Like ListBeanFactory but also includes elements in other lists defined in the include tag. as elements.

This is particularly useful when combined with the include factory, to include elements from other XML files.

For example:

<config>
 <bean config-class="java.util.List" config-factory="listInclude">

 <include>
      <item config-class="java.util.List" config-factory="include" filePath="fileToInclude.xml"/>
      <item config-class="java.util.List" config-factory="include" filePath="anotherFileToInclude.xml"/>
 </include>

 <item config-class="org.anchoranalysis.bean.SomeBean"/>
 <item config-class="org.anchoranalysis.bean.SomeBean"/>
 <item config-class="org.anchoranalysis.bean.SomeBean"/>

 </bean>
 </config>
Author:
Owen Feehan
  • Field Summary

    Fields inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    createBean(Class beanClass, org.apache.commons.configuration.beanutils.BeanDeclaration decl, Object param)
     

    Methods inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory

    createBeanInstance, getDefaultBeanClass, initBeanInstance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IncludeListBeanFactory

      public IncludeListBeanFactory()
      Default constructor.
  • Method Details

    • createBean

      public Object createBean(Class beanClass, org.apache.commons.configuration.beanutils.BeanDeclaration decl, Object param) throws Exception
      Specified by:
      createBean in interface org.apache.commons.configuration.beanutils.BeanFactory
      Overrides:
      createBean in class org.apache.commons.configuration.beanutils.DefaultBeanFactory
      Throws:
      Exception