org.apache.hivemind.util
Class PropertyUtils

java.lang.Object
  |
  +--org.apache.hivemind.util.PropertyUtils

public class PropertyUtils
extends java.lang.Object

A collection of static methods used to perform property-level access on arbitrary objects.

Author:
Howard Lewis Ship

Method Summary
static java.lang.Class getPropertyType(java.lang.Object target, java.lang.String propertyName)
          Returns the type of the named property.
static boolean isReadable(java.lang.Object target, java.lang.String propertyName)
           
static boolean isWritable(java.lang.Object target, java.lang.String propertyName)
          Returns true of the instance contains a writable property of the given type.
static java.lang.Object read(java.lang.Object target, java.lang.String propertyName)
          Updates the property of the target object.
static void write(java.lang.Object target, java.lang.String propertyName, java.lang.Object value)
          Updates the property of the target object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

write

public static void write(java.lang.Object target,
                         java.lang.String propertyName,
                         java.lang.Object value)
Updates the property of the target object.

Parameters:
target - the object to update
propertyName - the name of the property to be updated
value - the value to be stored into the target object property

isWritable

public static boolean isWritable(java.lang.Object target,
                                 java.lang.String propertyName)
Returns true of the instance contains a writable property of the given type.

Parameters:
target - the object to inspect
propertyName - the name of the property to check

isReadable

public static boolean isReadable(java.lang.Object target,
                                 java.lang.String propertyName)

read

public static java.lang.Object read(java.lang.Object target,
                                    java.lang.String propertyName)
Updates the property of the target object.

Parameters:
target - the object to update
propertyName - the name of a property toread

getPropertyType

public static java.lang.Class getPropertyType(java.lang.Object target,
                                              java.lang.String propertyName)
Returns the type of the named property.

Parameters:
target - the object to examine
propertyName - the name of the property to check