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

com.silentgo.utils.reflect.SGMethod Maven / Gradle / Ivy

There is a newer version: 0.1.16
Show newest version
package com.silentgo.utils.reflect;

import com.silentgo.utils.exception.UtilException;

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

/**
 * Project : SilentGo
 * Package : com.silentgo.utils.reflect
 *
 * @author teddyzhu
 *         

* Created by teddyzhu on 2017/1/5. */ public class SGMethod extends ParameterAnnotationMap { private String name; private String className; private String fullName; private Method method; public Method getMethod() { return method; } public void setMethod(Method method) { this.method = method; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassName() { return className; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public void setClassName(String className) { this.className = className; } public Object invoke(Object target, Object... objects) { if (!method.isAccessible()) { method.setAccessible(true); } try { return method.invoke(target, objects); } catch (IllegalAccessException | InvocationTargetException e) { throw new UtilException("invoke method error", e); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy