java.lang.Object
io.github.mmm.bean.impl.BeanCreator
- All Implemented Interfaces:
BeanFactory
Creator of
AbstractBean instances.- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<B extends WritableBean>
Bstatic <B extends AbstractBean>
BdoCreate(Class<B> type, WritableBean writable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mmm.bean.BeanFactory
create
-
Constructor Details
-
BeanCreator
public BeanCreator()The constructor.
-
-
Method Details
-
create
- Specified by:
createin interfaceBeanFactory- 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.
-
doCreate
public static <B extends AbstractBean> B doCreate(Class<B> type, WritableBean writable) throws ReflectiveOperationException - Type Parameters:
B- type ofAbstractBean.- Parameters:
type-ClassofAbstractBean.writable- theAbstractBeanto wrap asread-onlybean ornullto create a mutable bean.- Returns:
- the new bean instance.
- Throws:
ReflectiveOperationException- in case of an error.
-