Elexis API documentation
Version 2.1.6 as of December 11 2011

de.ralfebert.rcputils.properties
Class PropertyValue

java.lang.Object
  extended by de.ralfebert.rcputils.properties.PropertyValue
All Implemented Interfaces:
IValue

public class PropertyValue
extends java.lang.Object
implements IValue

PropertyValue: Resolves nested property Strings like "company.country.name". Use like this:

 PropertyValue prop = new PropertyValue("country.name");
 Object countryName = prop.getValue(someObject);
 
This class allows to use JFace Data Binding property support to get and set nested property values without observing them. Please note that this class is not prepared for a case where the classes of the objects change on the path to the property. For example, if you use "country.name" on a "Company" object once, it expects a "Company" object you use it the next time. WARNING: This uses internal data binding classes. This enhancement described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=285307 would allow to use official API instead of this class.

Author:
Ralf Ebert

Constructor Summary
PropertyValue(java.lang.String propertyName)
          Creates a PropertyValue to access the bean property referred by propertyName.
 
Method Summary
 java.lang.Object getValue(java.lang.Object object)
          Returns the property value referred by object."
 void setValue(java.lang.Object object, java.lang.Object value)
          Sets the property value referred by object."
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyValue

public PropertyValue(java.lang.String propertyName)
Creates a PropertyValue to access the bean property referred by propertyName.

Method Detail

getValue

public java.lang.Object getValue(java.lang.Object object)
Returns the property value referred by object."propertyName"

Specified by:
getValue in interface IValue

setValue

public void setValue(java.lang.Object object,
                     java.lang.Object value)
Sets the property value referred by object."propertyName" to value

Specified by:
setValue in interface IValue

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis