- All Known Implementing Classes:
AbstractBeanFactory,BeanCreator,BeanFactoryManager
public interface BeanFactory
Interface for a factory to create instances of
WritableBean. In case you are implementing beans extending
Bean, you can simply ignore this interface and create your instances with the new operator. However,
framework code should use this interface to create instances for a given class to support the flexibility provided by
this module.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault <B extends WritableBean>
B<B extends WritableBean>
Bstatic BeanFactoryget()
-
Method Details
-
create
- Type Parameters:
B- type of theWritableBean.- Parameters:
type- theClassreflecting theWritableBean.- Returns:
- a new instance of the
WritableBeanspecified by the givenClass. Iftypeis an interface, a generated implementation is used (either as dynamic proxy or generated at compile time). Otherwise if a class is given it needs to extendBean, be non-abstract and requires a non-arg constructor.
-
create
- Type Parameters:
B- type of theWritableBean.- Parameters:
type- theClassreflecting theWritableBean.beanClass- theBeanClassthat has to correspond to theClassgiven by parametertype.- Returns:
- a new instance of the
WritableBeanspecified by the givenClass. Iftypeis an interface, a dynamic proxy implementation is generated. Otherwise if a class is given it needs to extendBean, be non-abstract and requires a non-arg constructor.
-
get
- Returns:
- the instance of
BeanFactory.
-