-
- All Known Implementing Classes:
BeanCreator
,BeanFactoryManager
public interface BeanFactory
Interface 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 thenew
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
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 BeanFactory
get()
-
-
-
Method Detail
-
create
default <B extends WritableBean> B create(Class<B> type)
- Type Parameters:
B
- type of theWritableBean
.- Parameters:
type
- theClass
reflecting theWritableBean
.- Returns:
- a new instance of the
WritableBean
specified by the givenClass
. Iftype
is 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
- theClass
reflecting theWritableBean
.dynamic
- thedynamic
flag.- Returns:
- a new instance of the
WritableBean
specified by the givenClass
. Iftype
is 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
.
-
-