Class JdkBeanFactory
- java.lang.Object
-
- org.soulwing.prospecto.runtime.beans.JdkBeanFactory
-
- All Implemented Interfaces:
BeanFactory
public class JdkBeanFactory extends Object implements BeanFactory
ABeanFactory
that uses JDK-provided introspection facilities.- Author:
- Carl Harris
-
-
Constructor Summary
Constructors Constructor Description JdkBeanFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
construct(Class<T> beanClass, Object... properties)
Constructs an instance of a bean.<T> T
construct(Class<T> beanClass, Map properties)
Constructs an instance of a bean.
-
-
-
Method Detail
-
construct
public <T> T construct(Class<T> beanClass, Object... properties) throws Exception
Description copied from interface:BeanFactory
Constructs an instance of a bean.Constructs and injects property values, and invokes any
PostConstruct
initializers.- Specified by:
construct
in interfaceBeanFactory
- Type Parameters:
T
- type of bean to create- Parameters:
beanClass
- a bean class (must have a no-arg constructor)properties
- key-value pairs; each pair must correspond to a JavaBeans-style property ofbeanClass
- Returns:
- bean instance
- Throws:
Exception
-
construct
public <T> T construct(Class<T> beanClass, Map properties) throws Exception
Description copied from interface:BeanFactory
Constructs an instance of a bean.Constructs and injects property values, and invokes any
PostConstruct
initializers.- Specified by:
construct
in interfaceBeanFactory
- Type Parameters:
T
- type of bean to create- Parameters:
beanClass
- a bean class (must have a no-arg constructor)properties
- map of property values; each key in the map must correspond to a JavaBeans-style property ofbeanClass
- Returns:
- bean instance
- Throws:
Exception
-
-