-
- All Known Implementing Classes:
BeanCreator,BeanFactoryManager
public interface BeanFactoryInterface for a factory to create instances ofWritableBean. In case you are implementing beans extendingBean, you can simply ignore this interface and create your instances with thenewoperator. 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
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <B extends WritableBean>
Bcreate(Class<B> type)<B extends WritableBean>
Bcreate(Class<B> type, boolean dynamic)static BeanFactoryget()
-
-
-
Method Detail
-
create
default <B extends WritableBean> B create(Class<B> type)
- Type Parameters:
B- type of theWritableBean.- Parameters:
type- theClassreflecting theWritableBean.- 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.
-
create
<B extends WritableBean> B create(Class<B> type, boolean dynamic)
- Type Parameters:
B- type of theWritableBean.- Parameters:
type- theClassreflecting theWritableBean.dynamic- thedynamicflag.- 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
static BeanFactory get()
- Returns:
- the instance of
BeanFactory.
-
-