org.iscreen.impl
Class OgnlPropertyMapping

java.lang.Object
  extended by org.iscreen.impl.OgnlPropertyMapping

public class OgnlPropertyMapping
extends java.lang.Object

Instances of this class are used to set OGNL properties on objects with a particular value. The "property" is actually an OGNL expression. The value can be set and used later, or it can be passed in to a map() method. The object instance that contains the property (and will have its "property" set) is passed it dynamically as part of the map() method. This class is used to set constraints, failure objects and services.

Author:
Shellman, Dan

Field Summary
protected  java.lang.String property
           
protected  java.lang.Object value
           
 
Constructor Summary
OgnlPropertyMapping(java.lang.String theProperty)
          Construct with given property.
OgnlPropertyMapping(java.lang.String theProperty, java.lang.Object theValue)
          Construct with both a property and the property's value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Implemented so that instances can be stored in sets/maps.
 int hashCode()
           
 void map(java.lang.Object obj)
          Sets a property on the object with the previously set value (from calling the setValue() method).
 void map(java.lang.Object obj, java.lang.Object theValue)
          Sets a property on the object with the given value (any value set using the setValue() method is ignored in this case).
 void setValue(java.lang.Object theValue)
          Sets the value the property will be set to.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

property

protected java.lang.String property

value

protected java.lang.Object value
Constructor Detail

OgnlPropertyMapping

public OgnlPropertyMapping(java.lang.String theProperty)
Construct with given property. No value is defined (value of the property).

Parameters:
theProperty - The property that will be set.

OgnlPropertyMapping

public OgnlPropertyMapping(java.lang.String theProperty,
                           java.lang.Object theValue)
Construct with both a property and the property's value.

Parameters:
theProperty - The property that will be set.
theValue - The value the property will be set to.
Method Detail

setValue

public void setValue(java.lang.Object theValue)
Sets the value the property will be set to.

Parameters:
theValue - The value the property will be set to.

map

public void map(java.lang.Object obj,
                java.lang.Object theValue)
Sets a property on the object with the given value (any value set using the setValue() method is ignored in this case).

Parameters:
obj - The object that will have its property set.
theValue - The value to set the property to.

map

public void map(java.lang.Object obj)
Sets a property on the object with the previously set value (from calling the setValue() method).

Parameters:
obj - The object that will have its property set.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Implemented so that instances can be stored in sets/maps. Two instances are considered equal if they have the same property.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare to
Returns:
Returns true if both have the same property.