public class DefaultComponent extends Object implements Bean
| Constructor and Description |
|---|
DefaultComponent(Class<? extends Object> klass)
Creates a new DefaultComponent for the given class.
|
DefaultComponent(Class<? extends Object> klass,
List<Object> initValues)
Creates a new DefaultComponent for the given class with the given init (constructor) values.
|
DefaultComponent(Class<? extends Object> klass,
List<Object> initValues,
Map<String,Object> props)
Creates a new DefaultComponent for the given class with the given property map and the given init (constructor) values.
|
DefaultComponent(Class<? extends Object> klass,
Map<String,Object> props)
Creates a new DefaultComponent for the given class with the given property map.
|
| Modifier and Type | Method and Description |
|---|---|
DefaultComponent |
addInitValue(Object value)
Adds a new init value for this component.
|
DefaultComponent |
addInitValues(List values)
Adds the init values from the given list to this component's class.
|
DefaultComponent |
addProperties(Map map)
Adds the properties from the given map in this component.
|
DefaultComponent |
addProperty(String name,
Object value)
Adds a property to be set in each new instance of this component's class.
|
Object |
getBean()
Returns an instance of the class this component represents.
|
Class<? extends Object> |
getType() |
public DefaultComponent(Class<? extends Object> klass)
klass - The class used to create new instances.public DefaultComponent(Class<? extends Object> klass, List<Object> initValues)
klass - The class used to create new instances.initValues - The values for the constructor.public DefaultComponent(Class<? extends Object> klass, Map<String,Object> props)
klass - The class used to create new instances.props - The properties that need to be injected in each instance.public DefaultComponent(Class<? extends Object> klass, List<Object> initValues, Map<String,Object> props)
klass - The class used to create new instances.initValues - The values for the constructor.props - The properties that need to be injected in each instance.public DefaultComponent addProperty(String name, Object value)
name - The name of the property or attribute.value - The value of the property or attribute.public DefaultComponent addProperties(Map map)
map - The properties to add in this component.public DefaultComponent addInitValue(Object value)
value - The init value to add to this component.public DefaultComponent addInitValues(List values)
values - The init values to add to this component.public Object getBean() throws InstantiationException
BeangetBean in interface BeanInstantiationException - if for any reason the instance cannot be created.Copyright © 2015. All Rights Reserved.