All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ssssssss.script.reflection.MethodInvoker Maven / Gradle / Ivy

The newest version!
package org.ssssssss.script.reflection;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MethodInvoker extends JavaInvoker {

	public MethodInvoker(Method method) {
		super(method);
	}

	public MethodInvoker(MethodInvoker invoker){
		super(invoker);
	}

	public MethodInvoker(Method method, Object defaultTarget) {
		super(method);
		setDefaultTarget(defaultTarget);
	}

	@Override
	public MethodInvoker copy() {
		return new MethodInvoker(this);
	}

	@Override
	Object invoke(Object target, Object... args) throws InvocationTargetException, IllegalAccessException {
		Object defaultTarget = getDefaultTarget();
		return getExecutable().invoke(defaultTarget == null ? target : defaultTarget, args);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy