public class IlpBeansObject extends Object implements IlpObject, PropertyChangeListener
IlpObject
interface to wrap
a bean. A bean, that is, a JavaBeans instance, is an instance of a class that
follows the JavaBeans conventions.
Instances of this class can be inserted in a data source. The
IlpDefaultDataSource
even provides a method
IlpDefaultDataSource.addBean(Object, Object)
that
creates an IlpBeansObject
instance from a Java object.
IlpBeansClass
VALUE_NOT_SET
Constructor and Description |
---|
IlpBeansObject(Object bean,
IlpClass ilpClass,
Object identifier)
Creates an
IlpObject instance to encapsulate the given bean. |
Modifier and Type | Method and Description |
---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes.
|
void |
fireEvent(AttributeValueEvent ev)
Fires the event to all listeners.
|
IlpAttributeGroup |
getAttributeGroup()
Returns the model that defines which attributes are allowed
in this instance.
|
Object |
getAttributeValue(IlpAttribute attribute)
Retrieves the value of an attribute of this object.
|
Object |
getAttributeValue(String name)
Returns the value of an attribute of this object.
|
Object |
getBean()
Returns the bean encapsulated by this instance.
|
Object |
getIdentifier()
Returns the identifier of the
IlpObject . |
IlpBeansClass |
getIlpBeansClass()
Returns the
IlpClass of this object. |
IlpClass |
getIlpClass()
Returns the
IlpClass of this object. |
boolean |
hasAttributeValue(IlpAttribute a)
Returns
true if the requested attribute exists in the bean. |
void |
initializeDefaultValues()
This method initializes the attribute values of the object with the default
attribute values, if there are any.
|
void |
propertyChange(PropertyChangeEvent evt)
Property change listener notification.
|
void |
removeAttributeValueListener(AttributeValueListener l)
Removes the given listener from the attribute value change
notifications.
|
void |
setAttributeValue(IlpAttribute attribute,
Object value)
Sets the value of an attribute of this object.
|
void |
setAttributeValue(String name,
Object value)
Sets the value of an attribute of this object.
|
String |
toString()
Returns the identifier as a string.
|
public IlpBeansObject(Object bean, IlpClass ilpClass, Object identifier)
IlpObject
instance to encapsulate the given bean.bean
- The bean wrapped by this instance.ilpClass
- The IlpClass
that corresponds to the bean's Java class,
or a sub-IlpClass
of an IlpBeansClass
.identifier
- The identifier of this instance.public Object getBean()
public IlpBeansClass getIlpBeansClass()
IlpClass
of this object.public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public Object getIdentifier()
IlpObject
.
This identifier is an Object
that can be used to uniquely identify
and retrieve this IlpObject
getIdentifier
in interface IlpObject
IlpObject
IlpTypeConverter
public IlpClass getIlpClass()
IlpClass
of this object.getIlpClass
in interface IlpObject
IlpClass
of this object.public IlpAttributeGroup getAttributeGroup()
getAttributeGroup
in interface IlpAttributeValueHolder
public Object getAttributeValue(IlpAttribute attribute)
getAttributeValue
in interface IlpAttributeValueHolder
attribute
- The attribute whose value is to be retrieved.public boolean hasAttributeValue(IlpAttribute a)
true
if the requested attribute exists in the bean.hasAttributeValue
in interface IlpAttributeValueHolder
public void setAttributeValue(IlpAttribute attribute, Object value)
setAttributeValue
in interface IlpAttributeValueHolder
attribute
- The attribute whose value is to be set.value
- The new value of the attribute.public Object getAttributeValue(String name)
getAttributeValue
in interface IlpAttributeValueHolder
name
- The name of the attribute whose value is to be retrieved.public void setAttributeValue(String name, Object value)
setAttributeValue
in interface IlpAttributeValueHolder
name
- The name of the attribute whose value is to be changed.value
- The new value of the attribute.public void addAttributeValueListener(AttributeValueListener l)
addAttributeValueListener
in interface IlpAttributeValueHolder
public void removeAttributeValueListener(AttributeValueListener l)
removeAttributeValueListener
in interface IlpAttributeValueHolder
public void fireEvent(AttributeValueEvent ev)
fireEvent
in interface IlpAttributeValueHolder
public void initializeDefaultValues()
initializeDefaultValues
in interface IlpObject
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.