com.townleyenterprises.common
Class PropertyProxy

java.lang.Object
  extended bycom.townleyenterprises.common.PropertyProxy
Direct Known Subclasses:
PropertySorter, QueryFilter

public class PropertyProxy
extends java.lang.Object

This class provides a simple way to dynamically access property values similar to the way it is handled in the Jakarta Struts package.

Version:
$Id: PropertyProxy.java,v 1.5 2004/07/29 18:34:07 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
PropertyProxy(java.lang.Class klass)
          The constructor takes the class which will be accessed.
 
Method Summary
 java.lang.Object getPropertyValue(java.lang.String property, java.lang.Object o)
          This method will retrieve the named property value for the specified object.
 java.lang.Class getSubjectClass()
          Retrieves the class of the subject of this proxy instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyProxy

public PropertyProxy(java.lang.Class klass)
The constructor takes the class which will be accessed.

Parameters:
klass - the java class
Method Detail

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String property,
                                         java.lang.Object o)
This method will retrieve the named property value for the specified object. The object must be of the same class as the class specified in the constructor.

Parameters:
property - the case-insensitive name of the property to retrieve from the object
o - the object to access
Throws:
java.lang.RuntimeException - if the property is not valid for the class

getSubjectClass

public java.lang.Class getSubjectClass()
Retrieves the class of the subject of this proxy instance.

Returns:
the Java class


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.