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

org.ibatis.cglib.proxy.MProxy Maven / Gradle / Ivy

Go to download

The jBATIS persistence framework will help you to significantly reduce the amount of Java code that you normally need to access a relational database. iBATIS simply maps JavaBeans to SQL statements using a very simple XML descriptor.

The newest version!
package org.ibatis.cglib.proxy;

import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;

public final class MProxy implements MethodProxy {
    AccessibleObject[] accessibleObjects;
    private final Method method;
    private final int mIdx;

    public MProxy(int mIdx, Method method, AccessibleObject... ao) {
        this.method = method;
        this.accessibleObjects = ao;
        this.mIdx = mIdx;
    }

    public  T getAnnotation(Class annotationClass) {
        for (AccessibleObject ao : accessibleObjects) {
            T t = ao.getAnnotation(annotationClass);
            if (t != null) {
                return t;
            }
        }
        return null;
    }

    @SuppressWarnings("deprecation")
    public Object invokeSuper(Object obj, Object... args) throws Throwable {
        return ((Factory) obj).$invoke(mIdx, args);
    }

    @Override
    public String getName() {
        return method.getName();
    }

    public Method getMethod() {
        return method;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy