common_helper/src/main/java/com/xiongyingqi/util/AopTargetUtils.java
public static Object getTarget(Object proxy) throws Exception {

        if (!AopUtils.isAopProxy(proxy)) {
            return proxy;//不是代理对象
        }

        if (AopUtils.isJdkDynamicProxy(proxy)) {
            return getJdkDynamicProxyTargetObject(proxy);
        } else { //cglib
            return getCglibProxyTargetObject(proxy);
        }

    }
public static Object getTarget(Object proxy) throws Exception {

        if (!AopUtils.isAopProxy(proxy)) {
            return proxy;//不是代理对象
        }

        if (AopUtils.isJdkDynamicProxy(proxy)) {
            return getJdkDynamicProxyTargetObject(proxy);
        } else { //cglib
            return getCglibProxyTargetObject(proxy);
        }

    }
public static Object getTarget ( Object proxy ) throws Exception { if ( ! AopUtils . isAopProxy ( proxy ) ) { return proxy ; //不是代理对象 } if ( AopUtils . isJdkDynamicProxy ( proxy ) ) { return getJdkDynamicProxyTargetObject ( proxy ) ; } else { //cglib return getCglibProxyTargetObject ( proxy ) ; } }
获取 目标对象

@param proxy 代理对象
@return
@throws Exception
获取 目标对象