Package com.aspectran.core.context.rule
Class BeanRule
- java.lang.Object
-
- com.aspectran.core.context.rule.BeanRule
-
- All Implemented Interfaces:
BeanReferenceable
,Replicable<BeanRule>
public class BeanRule extends java.lang.Object implements Replicable<BeanRule>, BeanReferenceable
The Class BeanRule.Created: 2009. 03. 09 PM 23:48:09
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLASS_DIRECTIVE_PREFIX
-
Constructor Summary
Constructors Constructor Description BeanRule()
-
Method Summary
Modifier and Type Method Description void
addAutowireRule(AutowireRule autowireRule)
void
addConstructorArgumentItemRule(ItemRule constructorArgumentItemRule)
Adds the constructor argument item rule.void
addPropertyItemRule(ItemRule propertyItemRule)
Adds the property item rule.java.util.List<AutowireRule>
getAutowireRuleList()
java.lang.Class<?>
getBeanClass()
Gets the bean class.BeanInstance
getBeanInstance()
Returns the instantiated object of this bean.BeanRefererType
getBeanRefererType()
Returns the Bean Referrer Type.java.lang.String
getClassName()
Gets the class type.ItemRuleMap
getConstructorArgumentItemRuleMap()
Gets the constructor argument item rule map.AutowireRule
getConstructorAutowireRule()
java.lang.String
getDescription()
Gets the description of this bean.java.lang.reflect.Method
getDestroyMethod()
Returns the destroy method.java.lang.String
getDestroyMethodName()
Returns the destroy method name.java.lang.Class<?>
getFactoryBeanClass()
Gets factory bean class.java.lang.String
getFactoryBeanId()
Gets the factory bean id.java.lang.reflect.Method
getFactoryMethod()
java.lang.String
getFactoryMethodName()
Gets the factory method name.ParameterBindingRule[]
getFactoryMethodParameterBindingRules()
FilterParameters
getFilterParameters()
Gets the filter parameters.java.lang.String
getId()
Returns the bean id.java.lang.Boolean
getImportant()
Returns whether this bean is important.java.lang.reflect.Method
getInitMethod()
Returns the initialization method.java.lang.String
getInitMethodName()
Returns the initialization method name.ParameterBindingRule[]
getInitMethodParameterBindingRules()
java.lang.Boolean
getLazyInit()
Returns whether this bean is to be lazily initialized.java.lang.String
getMaskPattern()
Gets the mask pattern.ItemRuleMap
getPropertyItemRuleMap()
Gets the property item rule map.java.lang.String
getScanPattern()
Gets the scan pattern.ScopeType
getScopeType()
Gets the scope type.java.lang.Boolean
getSingleton()
Returns whether this bean is a singleton.java.lang.Class<?>
getTargetBeanClass()
java.lang.String
getTargetBeanClassName()
boolean
isConstructorAutowireParsed()
boolean
isDisposableBean()
Returns whether this bean implements DisposableBean.boolean
isFactoryBean()
Returns whether this bean implements FactoryBean.boolean
isFactoryOffered()
boolean
isFactoryProductionRequired()
boolean
isFieldAutowireParsed()
boolean
isImportant()
Returns whether this bean is important.boolean
isInitializableBean()
Returns whether this bean implements InitializableBean.boolean
isInitializableTransletBean()
Returns whether this bean implements InitializableTransletBean.boolean
isInnerBean()
boolean
isLazyInit()
Returns whether this bean is to be lazily initialized.boolean
isMethodAutowireParsed()
boolean
isProxiable()
Returns whether this bean can be proxied.boolean
isProxied()
Returns whether this bean is proxied.boolean
isReplicated()
Returns whether this bean has been replicated.boolean
isSingleton()
Returns whether this bean is a singleton.ItemRule
newConstructorArgumentItemRule()
Adds a new constructor argument item rule and returns it.static BeanRule
newInnerBeanRule(java.lang.String className, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String factoryMethodName)
static BeanRule
newInnerOfferedFactoryBeanRule(java.lang.String factoryBeanId, java.lang.String factoryMethodName, java.lang.String initMethodName, java.lang.String destroyMethodName)
static BeanRule
newInstance(java.lang.String id, java.lang.String className, java.lang.String scanPattern, java.lang.String maskPattern, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String factoryMethodName, java.lang.String scope, java.lang.Boolean singleton, java.lang.Boolean lazyInit, java.lang.Boolean important)
static BeanRule
newOfferedFactoryBeanInstance(java.lang.String id, java.lang.String factoryBeanId, java.lang.String factoryMethodName, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String scope, java.lang.Boolean singleton, java.lang.Boolean lazyInit, java.lang.Boolean important)
ItemRule
newPropertyItemRule(java.lang.String propertyName)
Adds a new property rule with the specified name and returns it.BeanRule
replicate()
Creates and returns a new instance after replicating a rule or Object.static BeanRule
replicate(BeanRule beanRule)
void
setBeanClass(java.lang.Class<?> beanClass)
Sets the bean class.void
setBeanInstance(BeanInstance beanInstance)
Sets the instantiated object of this bean.void
setClassName(java.lang.String className)
Sets the class type.void
setConstructorArgumentItemRuleMap(ItemRuleMap constructorArgumentItemRuleMap)
Sets the constructor argument item rule map.void
setConstructorAutowireParsed(boolean constructorAutowireParsed)
void
setConstructorAutowireRule(AutowireRule constructorAutowireRule)
void
setDescription(java.lang.String description)
Sets the description of this bean.void
setDestroyMethod(java.lang.reflect.Method destroyMethod)
Sets the destroy method.void
setDestroyMethodName(java.lang.String destroyMethodName)
Sets the destroy method name.void
setFactoryBeanClass(java.lang.Class<?> factoryBeanClass)
Sets factory bean class.void
setFactoryBeanId(java.lang.String factoryBeanId)
Sets the factory bean id.void
setFactoryMethod(java.lang.reflect.Method factoryMethod)
void
setFactoryMethodName(java.lang.String factoryMethodName)
Sets the factory method name.void
setFactoryMethodParameterBindingRules(ParameterBindingRule[] parameterBindingRules)
void
setFactoryOffered(boolean factoryOffered)
void
setFieldAutowireParsed(boolean fieldAutowireParsed)
void
setFilterParameters(FilterParameters filterParameters)
Sets the filter parameters.void
setId(java.lang.String id)
Sets the bean id.void
setImportant(java.lang.Boolean important)
Sets whether this bean is important.void
setInitMethod(java.lang.reflect.Method initMethod)
Sets the initialization method.void
setInitMethodName(java.lang.String initMethodName)
Sets the initialization method name.void
setInitMethodParameterBindingRules(ParameterBindingRule[] parameterBindingRules)
void
setInnerBean(boolean innerBean)
void
setLazyInit(java.lang.Boolean lazyInit)
Sets whether this bean is to be lazily initialized.void
setMaskPattern(java.lang.String maskPattern)
Sets the mask pattern.void
setMethodAutowireParsed(boolean methodAutowireParsed)
void
setPropertyItemRuleMap(ItemRuleMap propertyItemRuleMap)
Sets the property item rule map.void
setProxied(boolean proxied)
Sets whether this bean is proxied.void
setReplicated(boolean replicated)
Sets whether this bean is replicated.void
setScanPattern(java.lang.String scanPattern)
Sets the scan pattern.void
setScopeType(ScopeType scopeType)
Sets the scope type.void
setSingleton(java.lang.Boolean singleton)
Sets whether this bean is a singleton.void
setTargetBeanClass(java.lang.Class<?> targetBeanClass)
java.lang.String
toString()
-
-
-
Field Detail
-
CLASS_DIRECTIVE_PREFIX
public static final java.lang.String CLASS_DIRECTIVE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Returns the bean id.- Returns:
- the bean id
-
setId
public void setId(java.lang.String id)
Sets the bean id.- Parameters:
id
- the bean id
-
getClassName
public java.lang.String getClassName()
Gets the class type.- Returns:
- the class type
-
setClassName
public void setClassName(java.lang.String className)
Sets the class type.- Parameters:
className
- the new class name
-
getBeanClass
public java.lang.Class<?> getBeanClass()
Gets the bean class.- Returns:
- the bean class
-
setBeanClass
public void setBeanClass(java.lang.Class<?> beanClass)
Sets the bean class.- Parameters:
beanClass
- the new bean class
-
getScanPattern
public java.lang.String getScanPattern()
Gets the scan pattern.- Returns:
- the scan pattern
-
setScanPattern
public void setScanPattern(java.lang.String scanPattern)
Sets the scan pattern.- Parameters:
scanPattern
- the new scan pattern
-
getMaskPattern
public java.lang.String getMaskPattern()
Gets the mask pattern.- Returns:
- the mask pattern
-
getFilterParameters
public FilterParameters getFilterParameters()
Gets the filter parameters.- Returns:
- the filter parameters
-
setFilterParameters
public void setFilterParameters(FilterParameters filterParameters)
Sets the filter parameters.- Parameters:
filterParameters
- the new filter parameters
-
setMaskPattern
public void setMaskPattern(java.lang.String maskPattern)
Sets the mask pattern.- Parameters:
maskPattern
- the new mask pattern
-
getScopeType
public ScopeType getScopeType()
Gets the scope type.- Returns:
- the scope type
-
setScopeType
public void setScopeType(ScopeType scopeType)
Sets the scope type.- Parameters:
scopeType
- the new scope type
-
getSingleton
public java.lang.Boolean getSingleton()
Returns whether this bean is a singleton.- Returns:
- whether this bean is a singleton
-
setSingleton
public void setSingleton(java.lang.Boolean singleton)
Sets whether this bean is a singleton.- Parameters:
singleton
- whether this bean is a singleton
-
isSingleton
public boolean isSingleton()
Returns whether this bean is a singleton.- Returns:
- whether this bean is a singleton
-
getFactoryBeanId
public java.lang.String getFactoryBeanId()
Gets the factory bean id.- Returns:
- the factory bean id
-
setFactoryBeanId
public void setFactoryBeanId(java.lang.String factoryBeanId)
Sets the factory bean id.- Parameters:
factoryBeanId
- the new factory bean id
-
getFactoryBeanClass
public java.lang.Class<?> getFactoryBeanClass()
Gets factory bean class.- Returns:
- the factory bean class
-
setFactoryBeanClass
public void setFactoryBeanClass(java.lang.Class<?> factoryBeanClass)
Sets factory bean class.- Parameters:
factoryBeanClass
- the factory bean class
-
getFactoryMethodName
public java.lang.String getFactoryMethodName()
Gets the factory method name.- Returns:
- the factory method
-
setFactoryMethodName
public void setFactoryMethodName(java.lang.String factoryMethodName)
Sets the factory method name.- Parameters:
factoryMethodName
- the new factory method name
-
getFactoryMethod
public java.lang.reflect.Method getFactoryMethod()
-
setFactoryMethod
public void setFactoryMethod(java.lang.reflect.Method factoryMethod)
-
getFactoryMethodParameterBindingRules
public ParameterBindingRule[] getFactoryMethodParameterBindingRules()
-
setFactoryMethodParameterBindingRules
public void setFactoryMethodParameterBindingRules(ParameterBindingRule[] parameterBindingRules)
-
isFactoryOffered
public boolean isFactoryOffered()
-
setFactoryOffered
public void setFactoryOffered(boolean factoryOffered)
-
isFactoryProductionRequired
public boolean isFactoryProductionRequired()
-
getTargetBeanClass
public java.lang.Class<?> getTargetBeanClass()
-
setTargetBeanClass
public void setTargetBeanClass(java.lang.Class<?> targetBeanClass)
-
getTargetBeanClassName
public java.lang.String getTargetBeanClassName()
-
getInitMethodName
public java.lang.String getInitMethodName()
Returns the initialization method name.- Returns:
- the initialization method name
-
setInitMethodName
public void setInitMethodName(java.lang.String initMethodName)
Sets the initialization method name.- Parameters:
initMethodName
- the new initialization method name
-
getInitMethod
public java.lang.reflect.Method getInitMethod()
Returns the initialization method.- Returns:
- the initialization method
-
setInitMethod
public void setInitMethod(java.lang.reflect.Method initMethod)
Sets the initialization method.- Parameters:
initMethod
- the initialization method
-
getInitMethodParameterBindingRules
public ParameterBindingRule[] getInitMethodParameterBindingRules()
-
setInitMethodParameterBindingRules
public void setInitMethodParameterBindingRules(ParameterBindingRule[] parameterBindingRules)
-
getDestroyMethodName
public java.lang.String getDestroyMethodName()
Returns the destroy method name.- Returns:
- the destroy method name
-
setDestroyMethodName
public void setDestroyMethodName(java.lang.String destroyMethodName)
Sets the destroy method name.- Parameters:
destroyMethodName
- the new destroy method name
-
getDestroyMethod
public java.lang.reflect.Method getDestroyMethod()
Returns the destroy method.- Returns:
- the destroy method
-
setDestroyMethod
public void setDestroyMethod(java.lang.reflect.Method destroyMethod)
Sets the destroy method.- Parameters:
destroyMethod
- the new destroy method
-
getLazyInit
public java.lang.Boolean getLazyInit()
Returns whether this bean is to be lazily initialized.- Returns:
- true, if this bean is to be lazily initialized
-
setLazyInit
public void setLazyInit(java.lang.Boolean lazyInit)
Sets whether this bean is to be lazily initialized.- Parameters:
lazyInit
- whether this bean is to be lazily initialized
-
isLazyInit
public boolean isLazyInit()
Returns whether this bean is to be lazily initialized.- Returns:
- true, if this bean is to be lazily initialized
-
getImportant
public java.lang.Boolean getImportant()
Returns whether this bean is important.- Returns:
- whether this bean is important
-
setImportant
public void setImportant(java.lang.Boolean important)
Sets whether this bean is important. If specified as an important bean, it can not be overridden by another bean rule with the same name.- Parameters:
important
- whether important bean
-
isImportant
public boolean isImportant()
Returns whether this bean is important.- Returns:
- whether this bean is important
-
getConstructorArgumentItemRuleMap
public ItemRuleMap getConstructorArgumentItemRuleMap()
Gets the constructor argument item rule map.- Returns:
- the constructor argument item rule map
-
setConstructorArgumentItemRuleMap
public void setConstructorArgumentItemRuleMap(ItemRuleMap constructorArgumentItemRuleMap)
Sets the constructor argument item rule map.- Parameters:
constructorArgumentItemRuleMap
- the new constructor argument item rule map
-
newConstructorArgumentItemRule
public ItemRule newConstructorArgumentItemRule()
Adds a new constructor argument item rule and returns it.- Returns:
- the constructor argument item rule
-
addConstructorArgumentItemRule
public void addConstructorArgumentItemRule(ItemRule constructorArgumentItemRule)
Adds the constructor argument item rule.- Parameters:
constructorArgumentItemRule
- the constructor argument item rule
-
getPropertyItemRuleMap
public ItemRuleMap getPropertyItemRuleMap()
Gets the property item rule map.- Returns:
- the property item rule map
-
setPropertyItemRuleMap
public void setPropertyItemRuleMap(ItemRuleMap propertyItemRuleMap)
Sets the property item rule map.- Parameters:
propertyItemRuleMap
- the new property item rule map
-
newPropertyItemRule
public ItemRule newPropertyItemRule(java.lang.String propertyName)
Adds a new property rule with the specified name and returns it.- Parameters:
propertyName
- the property name- Returns:
- the property item rule
-
addPropertyItemRule
public void addPropertyItemRule(ItemRule propertyItemRule)
Adds the property item rule.- Parameters:
propertyItemRule
- the new property item rule
-
isFactoryBean
public boolean isFactoryBean()
Returns whether this bean implements FactoryBean.- Returns:
- the boolean
-
isDisposableBean
public boolean isDisposableBean()
Returns whether this bean implements DisposableBean.- Returns:
- the boolean
-
isInitializableBean
public boolean isInitializableBean()
Returns whether this bean implements InitializableBean.- Returns:
- the boolean
-
isInitializableTransletBean
public boolean isInitializableTransletBean()
Returns whether this bean implements InitializableTransletBean.- Returns:
- the boolean
-
isInnerBean
public boolean isInnerBean()
-
setInnerBean
public void setInnerBean(boolean innerBean)
-
isReplicated
public boolean isReplicated()
Returns whether this bean has been replicated.- Returns:
- true if this bean has been replicated; false otherwise
-
setReplicated
public void setReplicated(boolean replicated)
Sets whether this bean is replicated.- Parameters:
replicated
- true, if this bean is replicated
-
isProxied
public boolean isProxied()
Returns whether this bean is proxied.- Returns:
- true if this bean is proxied; false otherwise
-
setProxied
public void setProxied(boolean proxied)
Sets whether this bean is proxied.- Parameters:
proxied
- true, if this bean is proxied
-
isProxiable
public boolean isProxiable()
Returns whether this bean can be proxied.- Returns:
- true if this bean can be proxied; false otherwise
-
getAutowireRuleList
public java.util.List<AutowireRule> getAutowireRuleList()
-
addAutowireRule
public void addAutowireRule(AutowireRule autowireRule)
-
getConstructorAutowireRule
public AutowireRule getConstructorAutowireRule()
-
setConstructorAutowireRule
public void setConstructorAutowireRule(AutowireRule constructorAutowireRule)
-
isConstructorAutowireParsed
public boolean isConstructorAutowireParsed()
-
setConstructorAutowireParsed
public void setConstructorAutowireParsed(boolean constructorAutowireParsed)
-
isFieldAutowireParsed
public boolean isFieldAutowireParsed()
-
setFieldAutowireParsed
public void setFieldAutowireParsed(boolean fieldAutowireParsed)
-
isMethodAutowireParsed
public boolean isMethodAutowireParsed()
-
setMethodAutowireParsed
public void setMethodAutowireParsed(boolean methodAutowireParsed)
-
getBeanInstance
public BeanInstance getBeanInstance()
Returns the instantiated object of this bean.- Returns:
- the instantiated object of this bean
-
setBeanInstance
public void setBeanInstance(BeanInstance beanInstance)
Sets the instantiated object of this bean.- Parameters:
beanInstance
- the instantiated object of this bean
-
getDescription
public java.lang.String getDescription()
Gets the description of this bean.- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of this bean.- Parameters:
description
- the new description
-
replicate
public BeanRule replicate()
Description copied from interface:Replicable
Creates and returns a new instance after replicating a rule or Object.- Specified by:
replicate
in interfaceReplicable<BeanRule>
- Returns:
- replicated rule or new instance of Object
-
getBeanRefererType
public BeanRefererType getBeanRefererType()
Description copied from interface:BeanReferenceable
Returns the Bean Referrer Type.- Specified by:
getBeanRefererType
in interfaceBeanReferenceable
- Returns:
- the Bean Referrer Type
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newInstance
public static BeanRule newInstance(java.lang.String id, java.lang.String className, java.lang.String scanPattern, java.lang.String maskPattern, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String factoryMethodName, java.lang.String scope, java.lang.Boolean singleton, java.lang.Boolean lazyInit, java.lang.Boolean important) throws IllegalRuleException
- Throws:
IllegalRuleException
-
newOfferedFactoryBeanInstance
public static BeanRule newOfferedFactoryBeanInstance(java.lang.String id, java.lang.String factoryBeanId, java.lang.String factoryMethodName, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String scope, java.lang.Boolean singleton, java.lang.Boolean lazyInit, java.lang.Boolean important) throws IllegalRuleException
- Throws:
IllegalRuleException
-
newInnerBeanRule
public static BeanRule newInnerBeanRule(java.lang.String className, java.lang.String initMethodName, java.lang.String destroyMethodName, java.lang.String factoryMethodName) throws IllegalRuleException
- Throws:
IllegalRuleException
-
newInnerOfferedFactoryBeanRule
public static BeanRule newInnerOfferedFactoryBeanRule(java.lang.String factoryBeanId, java.lang.String factoryMethodName, java.lang.String initMethodName, java.lang.String destroyMethodName) throws IllegalRuleException
- Throws:
IllegalRuleException
-
-