|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Definition of an interface for declaring a bean in a configuration file.
Commons Configurations allows to define beans (i.e. simple Java objects) in configuration files, which can be created at runtime. This is especially useful if you program against interfaces and want to define the concrete implementation class is a configuration file.
This interface defines methods for retrieving all information about a bean that should be created from a configuration file, e.g. the bean's properties or the factory to use for creating the instance. With different implementations different "layouts" of bean declarations can be supported. For instance if an XML configuration file is used, all features of XML (e.g. attributes, nested elements) can be used to define the bean. In a properties file the declaration format is more limited. The purpose of this interface is to abstract from the concrete declaration format.
Method Summary | |
String |
getBeanClassName()
Returns the name of the bean class, from which an instance is to be created. |
String |
getBeanFactoryName()
Returns the name of the BeanFactory that should be used
for creating the bean instance. |
Object |
getBeanFactoryParameter()
Here an arbitrary object can be returned that will be passed to the bean factory. |
Map |
getBeanProperties()
Returns a map with properties that should be initialized on the newly created bean. |
Map |
getNestedBeanDeclarations()
Returns a map with declarations for beans that should be set as properties of the newly created bean. |
Method Detail |
public String getBeanFactoryName()
BeanFactory
that should be used
for creating the bean instance. This can be null, then a default
factory will be used.
public Object getBeanFactoryParameter()
public String getBeanClassName()
public Map getBeanProperties()
public Map getNestedBeanDeclarations()
BeanDeclaration
implementations. They will be treated like this declaration (in a
recursive manner), and the resulting beans are assigned to the
corresponding properties.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |