org.wdssii.core
Class PropertyGetterSetter
java.lang.Object
org.wdssii.core.PropertyGetterSetter
public class PropertyGetterSetter
- extends Object
A generic property setter that uses a Properties file to set properties on an
object. Built on top of java.beans
- Author:
- lakshman
Field Summary |
private static org.apache.commons.logging.Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
PropertyGetterSetter
public PropertyGetterSetter()
setProperties
public static void setProperties(Object object,
Properties props)
- Invoke any setter method on object if the corresponding property is found
in props. If any properties are not set, explanation of why is sent to
the debug log.
- Parameters:
object
- whose setter methods should be invokedprops
- contains name=value pairs with the corresponding properties
getProperties
public static Properties getProperties(Object object)
- Invoke all getter methods on object
- Parameters:
object
- whose getter methods should be invoked
- Returns:
- properties object that contains name=value pairs with the
corresponding properties
setProperty
public static boolean setProperty(Object object,
Method setter,
String name,
String value)
- Invoke setter on object with the provided value.
- Parameters:
object
- setter
- name
- name of property (used only for logging)value
- value to call setter method with
- Returns:
- whether the setter method succeeded. On failure, see debug log.