Package org.grails.spring
Interface BeanConfiguration
- All Known Implementing Classes:
DefaultBeanConfiguration
public interface BeanConfiguration
Represents a runtime bean configuration.
Credit must go to Solomon Duskis and the
article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
- Since:
- 0.3
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(String propertyName, Object propertyValue) Adds a property value to this bean.org.springframework.beans.factory.support.AbstractBeanDefinitiongetName()getPropertyValue(String name) Returns the value of the given property or throws a MissingPropertyException.booleanhasProperty(String name) Returns true if the bean config has the name property set.booleansetAbstract(boolean isAbstract) Sets the BeanConfiguration as an Abstract bean definitionsetAutowire(String type) Sets the autowire type, either "byType" or "byName"voidsetBeanDefinition(org.springframework.beans.factory.config.BeanDefinition definition) setDependsOn(String[] dependsOn) Sets the names of the beans this bean configuration depends onsetDestroyMethod(String methodName) Sets the name of the method to call when destroying the bean.setFactoryBean(String beanName) setFactoryMethod(String methodName) voidSets the name of the bean in the app ctx.voidSets the name of the parent bean.voidsetPropertyValue(String property, Object newValue) Sets a property value on the bean configuration
-
Field Details
-
AUTOWIRE_BY_TYPE
- See Also:
-
AUTOWIRE_BY_NAME
- See Also:
-
-
Method Details
-
getName
String getName()- Returns:
- The name of the bean
-
isSingleton
boolean isSingleton()- Returns:
- true if the bean is singleton
-
getBeanDefinition
org.springframework.beans.factory.support.AbstractBeanDefinition getBeanDefinition()- Returns:
- The Spring bean definition instance
-
addProperty
Adds a property value to this bean.- Parameters:
propertyName- The name of the propertypropertyValue- The value of the property- Returns:
- Returns this bean configuration
-
setDestroyMethod
Sets the name of the method to call when destroying the bean.- Parameters:
methodName- The method name- Returns:
- This bean configuration
-
setDependsOn
Sets the names of the beans this bean configuration depends on- Parameters:
dependsOn- Bean names it depends on- Returns:
- This bean configuration
-
setFactoryBean
- Parameters:
beanName-- Returns:
- This BeanConfiguration
-
setFactoryMethod
- Parameters:
methodName-- Returns:
- This BeanConfiguration
-
setAutowire
Sets the autowire type, either "byType" or "byName"- Parameters:
type- The type- Returns:
- This BeanConfiguration
-
setName
Sets the name of the bean in the app ctx.- Parameters:
beanName- The bean name
-
hasProperty
Returns true if the bean config has the name property set.- Parameters:
name- The name of the property- Returns:
- true if it does have a property with the given name
-
getPropertyValue
Returns the value of the given property or throws a MissingPropertyException.- Parameters:
name- The name of the property- Returns:
- The value of the property
-
setPropertyValue
Sets a property value on the bean configuration- Parameters:
property- The name of the propertynewValue- The value
-
setAbstract
Sets the BeanConfiguration as an Abstract bean definition- Parameters:
isAbstract- Whether its abstract or not- Returns:
- This BeanConfiguration object
-
setParent
Sets the name of the parent bean.- Parameters:
name- Either a string which is the name of the bean, a RuntimeBeanReference or a BeanConfiguration
-
setBeanDefinition
void setBeanDefinition(org.springframework.beans.factory.config.BeanDefinition definition)
-