- java.lang.Object
-
- io.github.mmm.bean.impl.BeanCreator
-
- All Implemented Interfaces:
BeanFactory
public final class BeanCreator extends Object implements BeanFactory
Creator ofAbstractBean
instances.- Since:
- 1.0.0
- See Also:
doCreate(Class)
-
-
Constructor Summary
Constructors Constructor Description BeanCreator()
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <B extends WritableBean>
Bcreate(Class<B> type, boolean dynamic)
static <B extends AbstractBean>
BdoCreate(Class<B> type)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.bean.BeanFactory
create
-
-
-
-
Method Detail
-
create
public <B extends WritableBean> B create(Class<B> type, boolean dynamic)
- Specified by:
create
in interfaceBeanFactory
- 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.
-
doCreate
public static <B extends AbstractBean> B doCreate(Class<B> type) throws ReflectiveOperationException
- Type Parameters:
B
- type ofAbstractBean
.- Parameters:
type
-Class
ofAbstractBean
.- Returns:
- the new bean instance.
- Throws:
ReflectiveOperationException
- in case of an error.
-
-