java.lang.Object | +--org.apache.log4j.config.PropertySetter
Object | General purpose Object property setter. |
PropertyDescriptor[] |
PropertySetter(Object obj) Create a new PropertySetter for the specified Object. |
void | activate() |
Object | convertArg(String val, Class type) Convert val a String parameter to an object of a given type. |
PropertyDescriptor | getPropertyDescriptor(String name) |
void | Uses JavaBeans Introspector to computer setters of object to be configured. |
static void | setProperties(Object obj, Properties properties, String prefix) Set the properties of an object passed as a parameter in one go. |
void | setProperties(Properties properties, String prefix) Set the properites for the object that match the prefix passed as parameter. |
void | setProperty(String name, String value) Set a property on this PropertySetter's Object. |
void | setProperty(PropertyDescriptor prop, String name, String value) Set the named property given a PropertyDescriptor. |
protected Object obj
PropertySetter ps = new PropertySetter(anObject); ps.set("name", "Joe"); ps.set("age", "32"); ps.set("isMale", "true")will cause the invocations anObject.setName("Joe"), anObject.setAge(32), and setMale(true) if such methods exist with those signatures. Otherwise an IntrospectionException are thrown.
protected PropertyDescriptor[] props
public PropertySetter(Object obj)
public void activate()
protected Object convertArg(String val, Class type)
val
a String parameter to an object of a
given type.
protected PropertyDescriptor getPropertyDescriptor(String name)
protected void introspect()
public static void setProperties(Object obj, Properties properties, String prefix)
properties
are parsed relative to a
prefix
.
public void setProperties(Properties properties, String prefix)
prefix
passed as parameter.
public void setProperty(PropertyDescriptor prop, String name, String value)
public void setProperty(String name, String value)