Here you can find the source of invokeMethod(Object target, String thisMethod, Object value)
Parameter | Description |
---|---|
target | The new param value |
value | The new param value |
thisMethod | Description of the Parameter |
public static boolean invokeMethod(Object target, String thisMethod, Object value)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { /**//from w ww . j av a 2 s . c o m * Invokes the specified method * * @param target The new param value * @param value The new param value * @param thisMethod Description of the Parameter * @return Description of the Returned Value */ public static boolean invokeMethod(Object target, String thisMethod, Object value) { try { if (value != null) { Class[] argTypes = new Class[] { value.getClass() }; Method method = target.getClass().getMethod(thisMethod, argTypes); method.invoke(target, new Object[] { value }); } } catch (Exception e) { //e.printStackTrace(System.out); if (System.getProperty("DEBUG") != null) { System.out.println("ObjectUtils-> invokeMethod Exception"); } return false; } return true; } }