|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gnu.beanfactory.BeanDefinitionImpl
Defines the URL, class name, scope and initial properties for a bean. All beans that are instantiated through the BeanFactory framework must be defined by an instance of this class. This class in instantiated by a DefinitionLoader instance.
Normal use of the BeanFactory framework should not involve direct interaction with this class. However, its implementation allows instances to be safely exposed in an immutable manner.
DefinitionLoader| Constructor Summary | |
BeanDefinitionImpl()
|
|
| Method Summary | |
void |
assertMutable()
Asserts that the bean definition has not been frozen. |
BeanDefinition |
copy()
|
boolean |
equals(java.lang.Object obj)
Determines whether two bean definitions define the same instance. |
long |
getAccessCount()
Gives an approximate number of times that this bean has been requested. |
BeanSetter |
getBeanSetter()
Obtains a BeanSetter instance for the current bean. |
java.lang.ClassLoader |
getClassLoader()
|
java.lang.String |
getClassName()
Obtains the fully qualified class name for this definition. |
java.lang.Class |
getClazz()
Get the class definition for this bean. |
java.lang.String |
getDelimiter()
|
java.lang.String |
getName()
Obtains the URL for this definition. |
java.util.Properties |
getOriginalProperties()
|
java.lang.String |
getParent()
Obtains the URL of this definition's "parent". |
java.util.Set |
getPropertyNames()
Obtains a set of property names (Strings) defined for this bean. |
java.lang.String |
getPropertyValue(java.lang.String name)
Obtains the String value for a particular property. |
int |
getScopeCode()
Obtains the int code for this definition's scope. |
java.lang.String |
getScopeName()
Obtains the name of this definition's defined scope. |
boolean |
getStartup()
Boolean flag indicating whether this bean will be loaded when the BeanFactory container is initialzied. |
java.lang.String |
getURL()
Obtains the URL for this definition. |
int |
hashCode()
Computes hashcode based on the definition's URL. |
void |
inherit(DefinitionLoader dl,
java.util.Set set)
|
boolean |
isMutable()
|
boolean |
isScopeExplicit()
Returns true if the scope has been explicitly set. |
boolean |
isScopeJ2EE()
Returns true if the scope is: application, session, or request. |
boolean |
isValid()
Returns true if this BeanDefinition has been validated. |
void |
setClassLoader(java.lang.ClassLoader cl)
|
void |
setClassName(java.lang.String className)
Sets the class name for this definition. |
void |
setDelimiter(java.lang.String s)
|
void |
setName(java.lang.String urn)
Set the URL for the bean. |
void |
setParent(java.lang.String parentURL)
Sets the parent URL. |
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Sets the value of a particular property. |
void |
setScopeName(java.lang.String scopeName)
Sets the named scope. |
void |
setStartup(boolean startup)
|
java.lang.String |
toString()
|
void |
validate(DefinitionLoader dl)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public BeanDefinitionImpl()
| Method Detail |
public boolean isValid()
BeanDefinitionisValid in interface BeanDefinitionpublic long getAccessCount()
public java.util.Set getPropertyNames()
getPropertyNames in interface BeanDefinitiongnu.beanfactory.BeanDefinitionpublic java.lang.String getPropertyValue(java.lang.String name)
getPropertyValue in interface BeanDefinition
public void setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
propertyName - property name (following JavaBean naming conventions)propertyValue - string representation of the bean property valuepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getName()
getName in interface BeanDefinitionpublic java.lang.String getURL()
getURL in interface BeanDefinitionpublic int getScopeCode()
getScopeCode in interface BeanDefinitionBeanContextpublic java.lang.String getScopeName()
getScopeName in interface BeanDefinitionBeanContextpublic void setClassName(java.lang.String className)
className - fully qualified class nameIllegalStateException - If this method is called after the definition has been validated.public java.lang.String getClassName()
getClassName in interface BeanDefinition
public java.lang.Class getClazz()
throws java.lang.ClassNotFoundException
BeanDefinitiongetClazz in interface BeanDefinition
public BeanSetter getBeanSetter()
throws java.lang.ClassNotFoundException,
BeanFactoryException
BeanDefinitiongetBeanSetter in interface BeanDefinitiongnu.beanfactory.BeanDefinitionpublic void setName(java.lang.String urn)
urn - Uniform Resource NameIllegalStateException - If this method is called after the definition has been validated.public void setScopeName(java.lang.String scopeName)
scopeName - named scopeIllegalStateException - if this method is called after validate()public boolean isScopeExplicit()
BeanDefinitionisScopeExplicit in interface BeanDefinitionpublic java.lang.String getParent()
getParent in interface BeanDefinitionpublic void setParent(java.lang.String parentURL)
parentURL - the URL of the parent bean (may be null)IllegalStateException - if this method is called after validate()public void setStartup(boolean startup)
public boolean getStartup()
BeanDefinitiongetStartup in interface BeanDefinition
public void inherit(DefinitionLoader dl,
java.util.Set set)
throws BeanFactoryException
public void validate(DefinitionLoader dl)
throws BeanFactoryException
public void assertMutable()
IllegalStateException - if the definition is immutablepublic boolean isMutable()
public boolean isScopeJ2EE()
BeanDefinitionisScopeJ2EE in interface BeanDefinitionpublic BeanDefinition copy()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDelimiter()
getDelimiter in interface BeanDefinitionpublic void setDelimiter(java.lang.String s)
public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader cl)
public java.util.Properties getOriginalProperties()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||