- java.lang.Object
-
- io.github.mmm.bean.AbstractBeanFactory
-
- All Implemented Interfaces:
BeanFactory
public abstract class AbstractBeanFactory extends Object implements BeanFactory
Abstract base implementation ofBeanFactoryfor generated implementations.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractBeanFactory()The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(Class<?> beanInterface, Function<BeanClass,WritableBean> factory)<B extends WritableBean>
Bcreate(Class<B> type, BeanClass beanClass)-
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
-
add
protected void add(Class<?> beanInterface, Function<BeanClass,WritableBean> factory)
- Parameters:
beanInterface- theClassreflecting theWritableBeaninterface to register.factory- the factoryFunctionto create instances of thatWritableBeaninterface.
-
create
public <B extends WritableBean> B create(Class<B> type, BeanClass beanClass)
- 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.
-
-