public class IlpAttributeValueHolderSupport extends IlpAttributeValueChangeSupport implements IlpAttributeValueHolder, AttributeValueListener
VALUE_NOT_SET
Constructor and Description |
---|
IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model)
Creates a new attribute holder based on the given model.
|
IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model,
IlpAttributeValueHolder defaultHolder)
Creates a new attribute holder based on the given model.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes.
|
void |
attributeValueChange(AttributeValueEvent ev)
This method is called when an attribute value of the underlying
attribute holder is modified.
|
IlpAttributeGroup |
getAttributeGroup()
Returns the model that defines which attributes are allowed
in this instance.
|
Object |
getAttributeValue(IlpAttribute a)
Retrieves the value of an attribute of this object.
|
Object |
getAttributeValue(String name)
Returns the value of an attribute of this object.
|
boolean |
hasAttributeValue(IlpAttribute a)
Returns
true if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute. |
void |
recomputeDependentAttributes(IlpAttribute a)
Verifies if any of the computed attributes in the computed attribute list
depend on the given attribute.
|
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.
|
fireAttributeChange, fireEvent, getSource, hasAttributeValueNotification
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fireEvent
public IlpAttributeValueHolderSupport(IlpAttributeValueHolder source, IlpAttributeGroup model)
source
- The IlpAttributeValueHolder
that delegates its
method to this support class.model
- The attribute model.public IlpAttributeValueHolderSupport(IlpAttributeValueHolder source, IlpAttributeGroup model, IlpAttributeValueHolder defaultHolder)
source
- This is the real IlpAttributeValueHolder
.model
- This is the attribute model which defines the valid
attributes for this holder.defaultHolder
- This is a secondary
IlpAttributeValueHolder
in which to
look if the attribute is not set locally.public IlpAttributeGroup getAttributeGroup()
getAttributeGroup
in interface IlpAttributeValueHolder
public Object getAttributeValue(IlpAttribute a)
getAttributeValue
in interface IlpAttributeValueHolder
a
- The attribute.VALUE_NOT_SET
if no
value has been set.public boolean hasAttributeValue(IlpAttribute a)
true
if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute.hasAttributeValue
in interface IlpAttributeValueHolder
public void setAttributeValue(IlpAttribute attribute, Object value)
Object value = o.getAttributeValue(attribute); // Incorrect: the value is stored in the same object. The change is not // taken into account. value.modify(); o.setAttributeValue(attribute,value); // Correct: the new value is stored in a new object. The change is taken // into account. value = value.clone(); // Returns a new object value.modify(); o.setAttributeValue(attribute,value);
setAttributeValue
in interface IlpAttributeValueHolder
attribute
- The attribute.value
- The new value of the attribute or
VALUE_NOT_SET
to remove the value of the
attribute.IllegalArgumentException
- if the attribute cannot have
its value modified.public Object getAttributeValue(String name)
getAttributeValue
in interface IlpAttributeValueHolder
name
- The name of the attribute.VALUE_NOT_SET
if no
value has been set.public void setAttributeValue(String name, Object value)
Object value = o.getAttributeValue(name); // Incorrect: the value is stored in the same object. The change is not // taken into account. value.modify(); o.setAttributeValue(name,value); // Correct: the new value is stored in a new object. The change is taken // into account. value = value.clone(); // Returns a new object value.modify(); o.setAttributeValue(name,value);
setAttributeValue
in interface IlpAttributeValueHolder
name
- The name of the attribute.value
- The new value of the attribute or
VALUE_NOT_SET
to remove the value of the
attribute.IllegalArgumentException
- if the attribute cannot have
its value modified.public void attributeValueChange(AttributeValueEvent ev)
attributeValueChange
in interface AttributeValueListener
ev
- The attribute value event to be fired.public void addAttributeValueListener(AttributeValueListener l)
addAttributeValueListener
in interface IlpAttributeValueHolder
addAttributeValueListener
in class IlpAttributeValueChangeSupport
public void removeAttributeValueListener(AttributeValueListener l)
removeAttributeValueListener
in interface IlpAttributeValueHolder
removeAttributeValueListener
in class IlpAttributeValueChangeSupport
public void recomputeDependentAttributes(IlpAttribute a)
getAttributeValue
.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.