public class ObjectAttribute
extends java.lang.Object
implements java.lang.Cloneable, java.beans.PropertyChangeListener, java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
ObjectAttribute.ModifyValue
Model for a modified attribute value.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector |
addedValues |
protected AttributeDefinition |
attrDefinition
The attribute definition associated with this attribute.
|
protected java.util.Vector |
deletedValues |
protected java.util.Vector |
modifiedValues |
protected java.util.Vector |
values
All values that are associated with this attribute.
|
| Constructor and Description |
|---|
ObjectAttribute(AttributeDefinition attrDef)
Constructor that does not initialize its list of values.
|
ObjectAttribute(AttributeDefinition attrDef,
ValueComponent comp)
Constructor that initializes a single value.
|
ObjectAttribute(AttributeDefinition attrDef,
ValueComponent[] comps)
Constructor that initializes with a list of values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(ValueComponent comp)
Adds a ValueComponent to this attribute.
|
void |
addComponents(ValueComponent[] comp)
Adds a ValueComponent to this attribute.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
This method is used to register a listener for changes to this attribute.
|
void |
clearAddedAttributeValues()
This method removes all the values intended to be added to this attribute.
|
void |
clearDeletedAttributeValues()
This method removes all the values intended to be deleted from this attribute.
|
void |
clearModifiedAttributeValues()
This method removes all the values intended to be modified for this attribute.
|
java.lang.Object |
clone()
Creates an exact duplicate of this ObjectAttribute.
|
boolean |
contains(ValueComponent comp)
Tests if the attribute contains a specifed ValueComponent.
|
ValueComponent[] |
getAddedComponents()
Returns all value components added to this attribute.
|
AttributeDefinition |
getAttributeDefinition()
Returns the associated attribute definition.
|
ValueComponent[] |
getBeginingComponents() |
ValueComponent[] |
getBeginningComponents()
Returns all value components at the initialization of this attribute.
|
int |
getComponentCount()
Returns a count of all components associated with this attribute.
|
ValueComponent[] |
getDeletedComponents()
Returns all value components deleted from this attribute.
|
ObjectAttribute.ModifyValue[] |
getModifiedComponents()
Returns all value components modified in this attribute.
|
java.lang.String |
getName()
Returns the name of this attribute.
|
java.util.Enumeration |
getValueComponents()
Returns all components associated with this attribute.
|
java.lang.Object[] |
getValueComponentsAsArray()
Returns all components associated with this attribute as an array.
|
protected void |
notifyPropertyChangeListeners(java.beans.PropertyChangeEvent event)
Helper method that notifies all listeners of this attribute that the
attribute has changed.
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
This method is called when a property change event occurs.
|
void |
removeAllComponents()
Removes all ValueComponents from this attribute if the attribute is
not read-only.
|
boolean |
removeComponent(ValueComponent comp)
Removes a specific ValueComponent from this attribute.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
This method is used to remove a listener from being notified when
changes are made to this attribute.
|
void |
replaceComponent(ValueComponent newComp)
Replaces any existing values with a new component.
|
void |
replaceComponent(ValueComponent oldComp,
ValueComponent newComp)
Replaces one ValueComponent with another.
|
void |
replaceComponents(ValueComponent[] newComps)
Replaces any existing values with a new component.
|
void |
resetBeginingAttributeValues() |
void |
resetBeginningAttributeValues()
This method sets the initial values to the values intended for the attribue
after the attribute update.
|
java.lang.String |
toString()
Converts an attribute to a String.
|
protected AttributeDefinition attrDefinition
protected java.util.Vector values
protected java.util.Vector addedValues
protected java.util.Vector deletedValues
protected java.util.Vector modifiedValues
public ObjectAttribute(AttributeDefinition attrDef)
Do not use this constructor if this is a read-only attribute because the attribute value(s) will not be initialized.
attrDef - Attribute definition.public ObjectAttribute(AttributeDefinition attrDef, ValueComponent comp) throws NamespaceException
This constructor may be used for attributes including read-only. This method ensures that the value is the correct syntax. If the attribute is sized, it ensures the value is within the limits.
attrDef - Attribute definition.comp - Value to put in the attribute.NamespaceException - A condition occured that prevented the add:
public ObjectAttribute(AttributeDefinition attrDef, ValueComponent[] comps) throws NamespaceException
This constructor may be used for attributes including read-only. It ensures all values have the correct syntax, that only one value is added for single-valued attributes, and that all values are within the limits for a sized attribute.
attrDef - Attribute definition.comps - Value(s) to put in the attribute.NamespaceException - A condition occured that prevented the add:
public final void clearAddedAttributeValues()
This method is used by the namespace. When the values to add are written out the namespace calls this method to prevent the values from being added again on the next write.
public final void clearDeletedAttributeValues()
This method is used by the namespace. When the values to delete are written out the namespace calls this method to prevent the values from being deleted again on the next write.
public final void clearModifiedAttributeValues()
This method is used by the namespace. When the values to be modified are written out the namespace calls this method to prevent the values from being modified again on the next write.
public final void resetBeginningAttributeValues()
This method is used by the namespace. When the values are all written out this method sets the initial values to the current state of the attribute that exists after the write.
public final void resetBeginingAttributeValues()
public boolean contains(ValueComponent comp)
comp - ValueComponent to test for.public final AttributeDefinition getAttributeDefinition()
public void addComponent(ValueComponent comp) throws NamespaceException
comp - The ValueComponent to be added.NamespaceException - A condition occured that disallowed the add:
public void addComponents(ValueComponent[] comp) throws NamespaceException
This method may or may not add a specified ValueComponent to the attribute depending certain criteria. Id doesn't check for duplicate values in the ValueComponent array passed in. You should call getComponentCount to make sure all the ValueComponents were added because no error is returned when they aren't. In order to successfully add a ValueComponent to this attribute the following criteria must be met.
comp - The ValueComponents to be added.NamespaceException - A condition occured that disallowed the add.
One of the following conditions.
public void replaceComponent(ValueComponent oldComp, ValueComponent newComp) throws NamespaceException
oldComp - A currently associated ValueComponent.newComp - The replacement ValueComponent.NamespaceException - A condition occured which disallowed the replacement:
public void replaceComponent(ValueComponent newComp) throws NamespaceException
newComp - The replacement ValueComponent.NamespaceException - A condition occured which disallowed the replacement:
public void replaceComponents(ValueComponent[] newComps) throws NamespaceException
newComps - An array of replacement ValueComponents.NamespaceException - A condition occured which disallowed the replacement:
public final ValueComponent[] getAddedComponents()
This method is used by the namespace to retrieve the values to add to the attribute when written out.
public final ValueComponent[] getBeginningComponents()
public final ValueComponent[] getBeginingComponents()
public final ValueComponent[] getDeletedComponents()
This method is used by the namespace to retrieve the values to be deleted from the attribute when it is written out.
public final ObjectAttribute.ModifyValue[] getModifiedComponents()
This method is used by the namespace to retrieve the values to be modified in the attribute when it is written out.
public java.util.Enumeration getValueComponents()
public java.lang.Object[] getValueComponentsAsArray()
public int getComponentCount()
public java.lang.String toString()
toString in class java.lang.Objectpublic void removeAllComponents()
public boolean removeComponent(ValueComponent comp)
comp - The specific ValueComponent to remove from this attribute.public final java.lang.String getName()
public java.lang.Object clone()
clone in class java.lang.Objectpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerevent - The event.protected void notifyPropertyChangeListeners(java.beans.PropertyChangeEvent event)
event - The event.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The listener.
API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated ${TODAY} ${TSTAMP}.