Groovy Documentation

org.codenarc.util
Class PropertyUtil

java.lang.Object
  org.codenarc.util.PropertyUtil

class PropertyUtil

Contains property-related static utility methods

author:
Chris Mair
version:
$Revision: 113 $ - $Date: 2009-03-31 19:41:25 -0400 (Tue, 31 Mar 2009) $


Constructor Summary
private PropertyUtil()

Private constructor.

 
Method Summary
static void setPropertyFromString(Object object, String propertyName, String propertyValue)

Set the value of the named property on the specified Object from a String value.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

PropertyUtil

private PropertyUtil()
Private constructor. All methods are static.


 
Method Detail

setPropertyFromString

public static void setPropertyFromString(Object object, String propertyName, String propertyValue)
Set the value of the named property on the specified Object from a String value. If the name specifies an int, long or boolean value then parse the provided String value and convert to the appropriate type.
param:
object - the Object whose field should be set
param:
name - the property name to set
param:
value - the property value as a String
throws:
NoSuchFieldException - if the object does not contain the named field


 

Groovy Documentation