|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport org.codehaus.groovy.grails.commons.spring.DefaultBeanConfiguration
public class DefaultBeanConfiguration
Default implementation of the BeanConfiguration interface Credit must go to Solomon Duskis and the article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
Field Summary |
---|
Fields inherited from interface org.codehaus.groovy.grails.commons.spring.BeanConfiguration |
---|
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE |
Constructor Summary | |
---|---|
DefaultBeanConfiguration(Class clazz2)
|
|
DefaultBeanConfiguration(Class clazz2,
Collection constructorArguments)
|
|
DefaultBeanConfiguration(String name)
|
|
DefaultBeanConfiguration(String name2,
boolean prototype)
|
|
DefaultBeanConfiguration(String name,
Class clazz)
|
|
DefaultBeanConfiguration(String name,
Class clazz,
boolean prototype)
|
|
DefaultBeanConfiguration(String name2,
Class clazz2,
Collection args)
|
Method Summary | |
---|---|
BeanConfiguration |
addProperty(String propertyName,
Object propertyValue)
Adds a property value to this bean |
protected AbstractBeanDefinition |
createBeanDefinition()
|
AbstractBeanDefinition |
getBeanDefinition()
|
String |
getName()
|
Object |
getProperty(String property)
|
Object |
getPropertyValue(String name)
Returns the value of the given property or throws a MissingPropertyException |
boolean |
hasProperty(String name)
Returns true if the bean config has the name property set |
boolean |
isSingleton()
|
BeanConfiguration |
setAbstract(boolean isAbstract)
Sets the BeanConfiguration as an Abstract bean definition |
BeanConfiguration |
setAutowire(String type)
Sets the autowire type, either "byType" or "byName" |
void |
setBeanDefinition(BeanDefinition definition)
|
BeanConfiguration |
setDependsOn(String[] dependsOn)
Sets the names of the beans this bean configuration depends on |
BeanConfiguration |
setDestroyMethod(String methodName)
Sets the name of the method to call when destroying the bean |
BeanConfiguration |
setFactoryBean(String beanName)
|
BeanConfiguration |
setFactoryMethod(String methodName)
|
void |
setName(String beanName)
Sets the name of the bean in the app ctx |
void |
setParent(Object obj)
Sets the name of the parent bean |
void |
setProperty(String property,
Object newValue)
|
void |
setPropertyValue(String property,
Object newValue)
Sets a property value on the bean configuration |
Methods inherited from class groovy.lang.GroovyObjectSupport |
---|
getMetaClass, invokeMethod, setMetaClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultBeanConfiguration(String name, Class clazz)
public DefaultBeanConfiguration(String name, Class clazz, boolean prototype)
public DefaultBeanConfiguration(String name)
public DefaultBeanConfiguration(Class clazz2)
public DefaultBeanConfiguration(String name2, Class clazz2, Collection args)
public DefaultBeanConfiguration(String name2, boolean prototype)
public DefaultBeanConfiguration(Class clazz2, Collection constructorArguments)
Method Detail |
---|
public Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.GroovyObjectSupport
public void setProperty(String property, Object newValue)
setProperty
in interface groovy.lang.GroovyObject
setProperty
in class groovy.lang.GroovyObjectSupport
public String getName()
getName
in interface BeanConfiguration
public boolean isSingleton()
isSingleton
in interface BeanConfiguration
public AbstractBeanDefinition getBeanDefinition()
getBeanDefinition
in interface BeanConfiguration
public void setBeanDefinition(BeanDefinition definition)
setBeanDefinition
in interface BeanConfiguration
protected AbstractBeanDefinition createBeanDefinition()
public BeanConfiguration addProperty(String propertyName, Object propertyValue)
BeanConfiguration
addProperty
in interface BeanConfiguration
propertyName
- The name of the propertypropertyValue
- The value of the property
public BeanConfiguration setDestroyMethod(String methodName)
BeanConfiguration
setDestroyMethod
in interface BeanConfiguration
methodName
- The method name
public BeanConfiguration setDependsOn(String[] dependsOn)
BeanConfiguration
setDependsOn
in interface BeanConfiguration
dependsOn
- Bean names it depends on
public BeanConfiguration setFactoryBean(String beanName)
setFactoryBean
in interface BeanConfiguration
public BeanConfiguration setFactoryMethod(String methodName)
setFactoryMethod
in interface BeanConfiguration
public BeanConfiguration setAutowire(String type)
BeanConfiguration
setAutowire
in interface BeanConfiguration
type
- The type
public void setName(String beanName)
BeanConfiguration
setName
in interface BeanConfiguration
beanName
- The bean namepublic Object getPropertyValue(String name)
BeanConfiguration
getPropertyValue
in interface BeanConfiguration
name
- The name of the property
public boolean hasProperty(String name)
BeanConfiguration
hasProperty
in interface BeanConfiguration
name
- The name of the property
public void setPropertyValue(String property, Object newValue)
BeanConfiguration
setPropertyValue
in interface BeanConfiguration
property
- The name of the propertynewValue
- The valuepublic BeanConfiguration setAbstract(boolean isAbstract)
BeanConfiguration
setAbstract
in interface BeanConfiguration
isAbstract
- Whether its abstract or not
public void setParent(Object obj)
BeanConfiguration
setParent
in interface BeanConfiguration
obj
- Either a string which is the name of the bean, a RuntimeBeanReference or a BeanConfiguration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |