All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.tools.assembly.BeanReference
java.lang.Object
|
+----com.ibm.beans.tools.assembly.BeanReference
- public class BeanReference
- extends Object
- implements Serializable
Objects of this class are created by the assembly surface to represent each
bean added to the assembly. Each active subassembly is informed of changes
in the assembly using methods that take a BeanReference as argument. In
addition to containing a reference to the bean it represents, a
BeanReference also contains any shared meta-data associated with the bean,
such as its name and the ManagedBean from which it is derived. A
BeanReference object also supports bound properties that allow any
interested subassembly to be informed of changes to the shared bean data.
-
BeanReference(ManagedBean)
- Constructor called by the assembly surface when a new bean is added to
the assembly.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to the bean reference.
-
getAssemblyInfo()
- Returns the bean's AssemblyInfo MBElement, if any.
-
getBean()
- Returns the bean for which this is a reference.
-
getJavaName()
- Returns the bean field name within the assembled bean.
-
getManagedBean()
- Returns the ManagedBean from which this bean is derived.
-
getName()
- Returns the name assigned to this bean by the user for use by each of the
subassembly models and views.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener from the bean reference.
-
setModified(PropertyChangeEvent)
- Indicates that one or more properties of the bean changed.
-
setName(String)
- Sets the name to be associated with this bean in each of the subassembly
models and views.
BeanReference
public BeanReference(ManagedBean managedBean)
- Constructor called by the assembly surface when a new bean is added to
the assembly.
- Parameters:
- managedBean - The ManagedBean from which the bean is derived.
getBean
public Object getBean()
- Returns the bean for which this is a reference.
- Returns:
- The bean for which this is a reference.
getManagedBean
public ManagedBean getManagedBean()
- Returns the ManagedBean from which this bean is derived.
- Returns:
- The ManagedBean from which this bean is derived.
getName
public String getName()
- Returns the name assigned to this bean by the user for use by each of the
subassembly models and views. Because the concept of a named bean can be
useful across many models, the bean reference provides a central point
for accessing the name in a common fashion across all subassembly models.
- Returns:
- The name assigned to this bean by the user.
getJavaName
public String getJavaName()
- Returns the bean field name within the assembled bean. This value is the
name of the field that contains the reference to the bean within the Java
class that defines the assembled bean. This value is the name that should
be used by any generated Java code that needs to reference the bean.
- Returns:
- The field name of the bean within the assembled bean.
getAssemblyInfo
public MBElement getAssemblyInfo()
- Returns the bean's AssemblyInfo MBElement, if any. The AssemblyInfo
element contains the serialized contents of the assembly surface that was
used to originally generate the bean. If no AssemblyInfo MBElement is
available, null is returned.
- Returns:
- The AssemblyInfo MBElement for the bean if it is available, and
null otherwise.
setName
public void setName(String name)
- Sets the name to be associated with this bean in each of the subassembly
models and views. This is a bound property, therefore each subassembly
model can listen for changes to the name.
Each subassembly model should use the name contained in the bean
reference rather than define its own set of names to prevent the user
from having to deal with multiple naming schemes.
- Parameters:
- name - The name to be assigned to the bean.
setModified
public void setModified(PropertyChangeEvent pce)
- Indicates that one or more properties of the bean changed.
Because the bean associated with this bean reference may not have
implemented bound properties, any subassembly that makes changes to the
properties of a bean should call this method to allow any other
interested subassembly to become aware of the changes made to the bean.
- Parameters:
- pce - The PropertyChangeEvent describing the property change made to
the bean associated with this bean reference. Note that when
the PropertyChangeEvent is constructed, the source
parameter may be specified as null.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener pcl)
- Adds a listener to the bean reference. This method provides a way for a
subassembly to listen for changes made to the bean reference. In
particular, setting a listener provides a subassembly with a way to be
informed of changes to the bean name.
- Parameters:
- pcl - The listener to be added to the bean reference.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener pcl)
- Removes a listener from the bean reference.
- Parameters:
- pcl - The listener to be removed from the bean reference.
All Packages Class Hierarchy This Package Previous Next Index