Java Utililty Methods Reflection Method Getter Invoke

List of utility methods to do Reflection Method Getter Invoke

Description

The list of methods to do Reflection Method Getter Invoke are organized into topic(s).

Method

ObjectinvokeGetterMethod(final Method method, final Object object)
Invokes the supplied method on the supplied object.
try {
    return method.invoke(object);
} catch (IllegalAccessException | InvocationTargetException e) {
    throw new IllegalArgumentException(e);
ObjectinvokeGetterSafe(Object o, String name, boolean forceAccess)
invoke Getter Safe
try {
    return invokeGetter(o, name, forceAccess);
} catch (Exception e) {
    return nameOf(o) + "." + name + "() " + nameOf(e) + ": " + e.getMessage();
voidinvokeSetter(Object target, Class clazz, String methodName, String getterMethod, Object param)
invoke Setter
Method getter = clazz.getMethod(getterMethod, (Class[]) null);
Method setter = clazz.getMethod(methodName, new Class[] { getter.getReturnType() });
setter.invoke(target, param);
StringinvokeStringGetterSafe(Object o, String name)
invoke String Getter Safe
try {
    return invokeStringGetter(o, name);
} catch (Exception e) {
    return nameOf(o) + "." + name + "() " + nameOf(e) + ": " + e.getMessage();