|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.props.AbstractPropertyInvoker
public abstract class AbstractPropertyInvoker
Provides methods common to property invokers.
| Constructor Summary | |
|---|---|
AbstractPropertyInvoker()
|
|
| Method Summary | ||
|---|---|---|
protected Object |
convertSimpleType(Class<?> type,
String value)
Converts simple types that are common to all property invokers. |
|
protected abstract Object |
convertValue(Class<?> type,
String value)
Converts the supplied string value into an Object of the supplied type. |
|
protected Object |
createArrayEnumFromPropertyValue(Class<?> c,
String s)
Returns the enum array which represents the supplied class given the supplied string representation. |
|
protected Object |
createArrayTypeFromPropertyValue(Class<?> c,
String s)
Returns the object which represents an array of the supplied class given the supplied string representation. |
|
static Class<?> |
createClass(String className)
Creates the class with the supplied name. |
|
protected Object |
createTypeFromPropertyValue(Class<?> c,
String s)
Returns the object which represents the supplied class given the supplied string representation. |
|
protected static Enum<?> |
getEnum(Class<?> clazz,
String value)
Returns the enum for the supplied type and value. |
|
Set<String> |
getProperties()
Returns the property keys for this invoker. |
|
boolean |
hasProperty(String name)
Returns whether the supplied property exists for this invoker. |
|
protected void |
initialize(Class<?> c)
Initializes the properties cache 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 |
| Constructor Detail |
|---|
public AbstractPropertyInvoker()
| Method Detail |
|---|
protected void initialize(Class<?> c)
c - to read methods from
public void setProperty(Object object,
String name,
String value)
setProperty in interface PropertyInvokerobject - to invoke method onname - of the propertyvalue - of the property
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)
hasProperty in interface PropertyInvokername - to check
public Set<String> getProperties()
getProperties in interface PropertyInvoker
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
protected Object convertSimpleType(Class<?> type,
String value)
type - of object to convert value intovalue - to parse
protected static Enum<?> getEnum(Class<?> clazz,
String value)
clazz - of the enumvalue - of the enum
protected Object createTypeFromPropertyValue(Class<?> c,
String s)
c - type to instantiates - property value to parse
protected Object createArrayTypeFromPropertyValue(Class<?> c,
String s)
c - type to instantiates - property value to parse
protected Object createArrayEnumFromPropertyValue(Class<?> c,
String s)
c - type to instantiates - property value to parse
public static Object invokeMethod(Method method,
Object object,
Object arg)
method - to invokeobject - to invoke method onarg - to invoke method with
IllegalArgumentException - if an error occurs invoking the method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||