|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.props.AbstractPropertyInvoker
public abstract class AbstractPropertyInvoker
AbstractPropertyInvoker provides methods common to property
invokers.
| Field Summary | |
|---|---|
protected Class<?> |
clazz
Class to invoke methods on. |
protected org.apache.commons.logging.Log |
logger
Log for this class. |
protected Map<String,Method[]> |
properties
Map of all properties to their getter and setter methods. |
protected static Map<String,Map<String,Method[]>> |
PROPERTIES_CACHE
Cache of properties. |
| Constructor Summary | |
|---|---|
AbstractPropertyInvoker()
|
|
| Method Summary | ||
|---|---|---|
protected abstract Object |
convertValue(Class<?> type,
String value)
This converts the supplied string value into an Object of the appropriate supplied type. |
|
static Class<?> |
createClass(String className)
Creates the class with the supplied name. |
|
Set<String> |
getProperties()
This returns the property keys. |
|
boolean |
hasProperty(String name)
This returns whether the supplied property exists. |
|
protected void |
initialize(Class<?> c,
String domain)
Initializes the properties map with the supplied class. |
|
static
|
instantiateType(T type,
String className)
Creates an instance of the supplied type. |
|
static Object |
invokeMethod(Method method,
Object object,
Object arg)
Invokes the supplied method on the supplied object with the supplied argument. |
|
void |
setProperty(Object object,
String name,
String value)
This invokes the setter method for the supplied property name with the supplied value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Map<String,Map<String,Method[]>> PROPERTIES_CACHE
protected final org.apache.commons.logging.Log logger
protected Class<?> clazz
protected Map<String,Method[]> properties
| Constructor Detail |
|---|
public AbstractPropertyInvoker()
| Method Detail |
|---|
protected void initialize(Class<?> c,
String domain)
c - to read methods fromdomain - optional domain that properties are in
public void setProperty(Object object,
String name,
String value)
object - Object to invoke method onname - String property namevalue - String property value
IllegalArgumentException - if an invocation exception occurs
protected abstract Object convertValue(Class<?> type,
String value)
type - of object to convert value intovalue - to parse
public boolean hasProperty(String name)
name - String to check
boolean whether the supplied property existspublic Set<String> getProperties()
Set of property names
public static <T> T instantiateType(T type,
String className)
T - type of class returnedtype - of class to createclassName - to create
IllegalArgumentException - if the supplied class name cannot create
a new instance of Tpublic static Class<?> createClass(String className)
className - to create
IllegalArgumentException - if the supplied class name cannot be
created
public static Object invokeMethod(Method method,
Object object,
Object arg)
method - Method to invokeobject - Object to invoke method onarg - Object to invoke method with
Object produced by the invocation
IllegalArgumentException - if an error occurs invoking the method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||