org.progeeks.meta
Class IsolatedMutator

java.lang.Object
  extended by org.progeeks.meta.IsolatedMutator
All Implemented Interfaces:
PropertyMutator

public class IsolatedMutator
extends java.lang.Object
implements PropertyMutator

A PropertyMutator implementation that wraps a value without requiring a parent MetaObject thereby isolating the value for separate mutation. This is useful for cases where you want to edit a value with no ties to a parent object.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Field Summary
static java.lang.String PROP_SELF
           
 
Constructor Summary
IsolatedMutator(PropertyInfo info, java.lang.Object value)
           
IsolatedMutator(PropertyType type, java.lang.Object value)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds the specified PropertyChangeListener to this mutator.
 MetaObject getParentObject()
          Returns the object that contains this property.
 PropertyInfo getPropertyInfo()
          Returns the info associated with this property.
 java.lang.String getPropertyName()
          Returns the name of this property.
 java.lang.Object getValue()
          Returns the value of this property.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes the specified PropertyChangeListener from this mutator.
 void setValue(java.lang.Object value)
          Resets the value of this property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_SELF

public static final java.lang.String PROP_SELF
See Also:
Constant Field Values
Constructor Detail

IsolatedMutator

public IsolatedMutator(PropertyType type,
                       java.lang.Object value)

IsolatedMutator

public IsolatedMutator(PropertyInfo info,
                       java.lang.Object value)
Method Detail

getPropertyName

public java.lang.String getPropertyName()
Returns the name of this property.

Specified by:
getPropertyName in interface PropertyMutator

getParentObject

public MetaObject getParentObject()
Returns the object that contains this property. For MetaObject values, this method will return the value. For all other cases, this method returns null because there is no parent object. We provide parent=self identity for the meta-objects as a convenience for looking up meta-kits and such.

Specified by:
getParentObject in interface PropertyMutator

getPropertyInfo

public PropertyInfo getPropertyInfo()
Returns the info associated with this property.

Specified by:
getPropertyInfo in interface PropertyMutator

getValue

public java.lang.Object getValue()
Returns the value of this property.

Specified by:
getValue in interface PropertyMutator

setValue

public void setValue(java.lang.Object value)
Resets the value of this property.

Specified by:
setValue in interface PropertyMutator

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds the specified PropertyChangeListener to this mutator.

Specified by:
addPropertyChangeListener in interface PropertyMutator

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the specified PropertyChangeListener from this mutator.

Specified by:
removePropertyChangeListener in interface PropertyMutator


Copyright © 2002-2003 Paul Speed. All Rights Reserved.