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

org.jtwig.reflection.model.bean.BeanMethod Maven / Gradle / Ivy

There is a newer version: 5.87.0.RELEASE
Show newest version
package org.jtwig.reflection.model.bean;

import org.jtwig.reflection.exceptions.InvokeException;
import org.jtwig.reflection.model.java.JavaMethod;

import java.lang.reflect.InvocationTargetException;

public class BeanMethod {
    private final Object bean;
    private final JavaMethod method;

    public BeanMethod(Object bean, JavaMethod method) {
        this.bean = bean;
        this.method = method;
    }

    public JavaMethod method() {
        return method;
    }

    public Object invoke(Object[] arguments) {
        try {
            return method.invoke(bean, arguments);
        } catch (InvocationTargetException e) {
            throw new InvokeException(e);
        } catch (IllegalAccessException e) {
            throw new InvokeException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy