Spring Framework

org.springframework.beans.factory.config
Class RuntimeBeanReference

java.lang.Object
  extended by org.springframework.beans.factory.config.RuntimeBeanReference
All Implemented Interfaces:
BeanMetadataElement, BeanReference

public class RuntimeBeanReference
extends java.lang.Object
implements BeanReference

Immutable placeholder class used for a property value object when it's a reference to another bean in the factory, to be resolved at runtime.

Author:
Rod Johnson, Juergen Hoeller
See Also:
BeanDefinition.getPropertyValues(), BeanFactory.getBean(java.lang.String)

Constructor Summary
RuntimeBeanReference(java.lang.String beanName)
          Create a new RuntimeBeanReference to the given bean name, without explicitly marking it as reference to a bean in the parent factory.
RuntimeBeanReference(java.lang.String beanName, boolean toParent)
          Create a new RuntimeBeanReference to the given bean name, with the option to mark it as reference to a bean in the parent factory.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getBeanName()
          Return the target bean name that this reference points to (never null).
 java.lang.Object getSource()
          Return the configuration source Object for this metadata element (may be null).
 int hashCode()
           
 boolean isToParent()
          Return whether this is an explicit reference to a bean in the parent factory.
 void setSource(java.lang.Object source)
          Set the configuration source Object for this metadata element.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuntimeBeanReference

public RuntimeBeanReference(java.lang.String beanName)
Create a new RuntimeBeanReference to the given bean name, without explicitly marking it as reference to a bean in the parent factory.

Parameters:
beanName - name of the target bean

RuntimeBeanReference

public RuntimeBeanReference(java.lang.String beanName,
                            boolean toParent)
Create a new RuntimeBeanReference to the given bean name, with the option to mark it as reference to a bean in the parent factory.

Parameters:
beanName - name of the target bean
toParent - whether this is an explicit reference to a bean in the parent factory
Method Detail

getBeanName

public java.lang.String getBeanName()
Description copied from interface: BeanReference
Return the target bean name that this reference points to (never null).

Specified by:
getBeanName in interface BeanReference

isToParent

public boolean isToParent()
Return whether this is an explicit reference to a bean in the parent factory.


setSource

public void setSource(java.lang.Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.


getSource

public java.lang.Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Spring Framework