return method;
}
+ /**
+ * Some "getter" for a Method instance from given method name
+ *
+ * @param instance Actual instance to call
+ * @param targetClass Target class name
+ * @param methodName Method name
+ * @param value Value to check type from
+ * @return A Method instance
+ */
+ private Method getMethodFromName (final FrameworkInterface instance, final String targetClass, final String methodName, final Object value) throws NoSuchMethodException {
+ // Trace messahe
+ this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
+
+ // Get target class instance
+ Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
+
+ // Init field instance
+ Method method = null;
+
+ // Use reflection to get all attributes
+ method = c.getDeclaredMethod(methodName, value.getClass());
+
+ // Assert on field
+ assert (method instanceof Method) : "method is not a Method instance"; //NOI18N
+
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("method={0} - EXIT!", method)); //NOI18N
+
+ // Return it
+ return method;
+ }
+
/**
* Setter for self instance
*/
this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
// Get method instance
- Method method = this.getMethodFromName(instance, targetClass, methodName);
+ Method method = this.getMethodFromName(instance, targetClass, methodName, value);
// Try to get the value by invoking the method
method.invoke(instance, value);
this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1},value={2}", targetClass, methodName, value)); //NOI18N
// Get method to call
- Method method = this.getMethodFromName(instance, targetClass, methodName);
+ Method method = this.getMethodFromName(instance, targetClass, methodName, value);
// Get value from field
method.invoke(instance, value);