|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.ioc.DefaultComponent
public class DefaultComponent
The default implementation of a Mentawai IoC component. This component allows you to define constructor values and object properties.
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public Class<? extends Object> getType()
getType in interface Bean
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
Bean
getBean in interface BeanInstantiationException - if for any reason the instance cannot be created.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||