Class IncludeBeanFactory

Object
org.apache.commons.configuration.beanutils.DefaultBeanFactory
AnchorBeanFactory
IncludeBeanFactory
All Implemented Interfaces:
org.apache.commons.configuration.beanutils.BeanFactory

public class IncludeBeanFactory extends AnchorBeanFactory
Defines an AnchorBean in a separate file on the file-system.

This file is read from filePath and loaded and integrated with current bean, as if the XML was contained directly in the object being loaded.

By default, the referenced bean should be specified as <config><bean>bla blah</bean></config> in the included XML.

An optional parameter xpath allows referencing an another element in the XML tree. It defaults to bean.

The config high-level tag is not considered in the XML tree, and should not be part of xpath.

As an example: <input filePath="inputManager.xml" config-class="org.anchoranalysis.io.bean.input.InputManager" config-factory="include"/>

Author:
Owen Feehan
  • Field Summary

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

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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

    • IncludeBeanFactory

      public IncludeBeanFactory()
  • 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