public class ModelObject
extends java.lang.Object
implements java.lang.Cloneable
A ModelObject provides methods for setting arbitrary properties. Use the getData and setData methods to get and set properties for a model object. Registered property change listeners will be notified of any property change events.
A ModelObject has significant properties. If a ModelObject has significant properties, then only the significant properties will be considered when comparing one model object with another for equality. If no significant properties have been set, then all properties will be compared.
If you subclass this class, ensure that the subclass has a default constructor. The default constructor is used by the clone function.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
ModelObject() |
Modifier and Type | Method and Description |
---|---|
void | addMaskedProperty(java.lang.String maskedProperty)
Indicates that the specified property should be masked in the event of a dump.
|
void | addModelListener(IModelListener modelListener)
Adds a model listener to this object.
|
protected void | addParent(ModelObject parentModelObject, java.lang.String propertyName)
Add a model object as a parent to this model object.
|
void | addRefreshProtectedProperty(java.lang.String refreshProtectedProperty)
Indicates that the specified property should be preserved in the event of a refresh.
|
void | addSignificantProperty(java.lang.String significantProperty)
Indicates that the specified property name is a significant property.
|
void | addUserDataProperty(java.lang.String userDataProperty)
Indicates that the specified property should be transferred to the UserData element during the construction of a request Business Object Document.
|
java.lang.Object | clone()
Creates a clone of this object.
|
java.lang.String | dump()
Dump the contents of the model object.
|
boolean | equals(java.lang.Object obj)
Returns whether this model object is equal to the given object.
|
protected void | fireModelObjectChangedEvent(ModelObjectChangedEvent modelObjectChangedEvent)
Notify all of the model event listeners that a property has changed.
|
protected void | fireModelObjectChangedEvent(java.lang.String propertyName, java.lang.Object oldData, java.lang.Object newData)
Notify all of the model event listeners that a property has changed.
|
java.lang.Object | getData(java.lang.String name)
Gets the data with the specified property name.
|
java.lang.Object | getData(java.lang.String name, java.lang.Object defaultValue)
Gets the data with the specified property name.
|
ModelObject | getParent(java.lang.String propertyName)
Gets the parent model object with a specified property name.
|
ModelObject[] | getParents()
Returns an array of all of this model objects parent model objects
|
int | getPropertyCount()
Returns the number of properties stored in this model object.
|
java.util.Enumeration | getPropertyNames()
Returns all of the property names stored in this model object.
|
java.util.Enumeration | getUserDataPropertyNames()
Returns the names of the properties that have been designated as user data properties.
|
int | hashCode() |
boolean | isRefreshProtected(java.lang.String propertyName)
Indicates if the specified property name is a refresh protected property.
|
void | refresh(ModelObject refreshSource)
Refreshes this model object with the properties found in the specified model object.
|
void | removeMaskedProperty(java.lang.String maskedProperty)
Removes the specified property name as a masked property.
|
void | removeModelListener(IModelListener modelListener)
Removes a model listener from this object.
|
protected void | removeParent(ModelObject parentModelObject, java.lang.String propertyName)
Remove a parent from a model object.
|
void | removeRefreshProtectedProperty(java.lang.String refreshProtectedProperty)
Removes the specified property name as a refresh protected property.
|
void | removeSignificantProperty(java.lang.String significantProperty)
Removes the specified property name as a significant property.
|
void | removeUserDataProperty(java.lang.String userDataProperty)
Removes the specified property name as a user data property.
|
void | resumeListenerNotification()
Resume notification of model listeners.
|
void | resumeListenerNotification(boolean isFireEvent)
Resume notification of model listeners.
|
void | setData(java.lang.String name, java.lang.Object data)
Sets the data with the specified name.
|
void | shareContents(ModelObject modelObject)
Sets the properties of this model object to be the (identical) properties of the specified model object.
|
void | suspendListenerNotification()
Suspend notification of model listeners.
|
public static final java.lang.String COPYRIGHT
public void addModelListener(IModelListener modelListener)
public void removeModelListener(IModelListener modelListener)
public java.lang.Object getData(java.lang.String name)
public java.lang.Object getData(java.lang.String name, java.lang.Object defaultValue)
public void setData(java.lang.String name, java.lang.Object data)
public java.util.Enumeration getPropertyNames()
public int getPropertyCount()
public ModelObject getParent(java.lang.String propertyName)
public ModelObject[] getParents()
protected void fireModelObjectChangedEvent(java.lang.String propertyName, java.lang.Object oldData, java.lang.Object newData)
protected void fireModelObjectChangedEvent(ModelObjectChangedEvent modelObjectChangedEvent)
protected void addParent(ModelObject parentModelObject, java.lang.String propertyName)
protected void removeParent(ModelObject parentModelObject, java.lang.String propertyName)
public void suspendListenerNotification()
public void resumeListenerNotification()
public void resumeListenerNotification(boolean isFireEvent)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public void shareContents(ModelObject modelObject)
public void addSignificantProperty(java.lang.String significantProperty)
public void removeSignificantProperty(java.lang.String significantProperty)
public void addRefreshProtectedProperty(java.lang.String refreshProtectedProperty)
public void removeRefreshProtectedProperty(java.lang.String refreshProtectedProperty)
public void addMaskedProperty(java.lang.String maskedProperty)
public void removeMaskedProperty(java.lang.String maskedProperty)
public boolean isRefreshProtected(java.lang.String propertyName)
public void refresh(ModelObject refreshSource)
public void addUserDataProperty(java.lang.String userDataProperty)
public void removeUserDataProperty(java.lang.String userDataProperty)
public java.util.Enumeration getUserDataPropertyNames()
public boolean equals(java.lang.Object obj)
public java.lang.String dump()
To be used for debugging.
public int hashCode()