Package org.apache.ibatis.binding
Class MapperProxy<T>
- java.lang.Object
-
- org.apache.ibatis.binding.MapperProxy<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.reflect.InvocationHandler
public class MapperProxy<T> extends java.lang.Object implements java.lang.reflect.InvocationHandler, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MapperProxy.DefaultMethodInvoker
(package private) static interface
MapperProxy.MapperMethodInvoker
private static class
MapperProxy.PlainMethodInvoker
-
Field Summary
Fields Modifier and Type Field Description private static int
ALLOWED_MODES
private static java.lang.reflect.Constructor<java.lang.invoke.MethodHandles.Lookup>
lookupConstructor
private java.lang.Class<T>
mapperInterface
private java.util.Map<java.lang.reflect.Method,MapperProxy.MapperMethodInvoker>
methodCache
private static java.lang.reflect.Method
privateLookupInMethod
private static long
serialVersionUID
private SqlSession
sqlSession
-
Constructor Summary
Constructors Constructor Description MapperProxy(SqlSession sqlSession, java.lang.Class<T> mapperInterface, java.util.Map<java.lang.reflect.Method,MapperProxy.MapperMethodInvoker> methodCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private MapperProxy.MapperMethodInvoker
cachedInvoker(java.lang.reflect.Method method)
private java.lang.invoke.MethodHandle
getMethodHandleJava8(java.lang.reflect.Method method)
private java.lang.invoke.MethodHandle
getMethodHandleJava9(java.lang.reflect.Method method)
java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ALLOWED_MODES
private static final int ALLOWED_MODES
- See Also:
- Constant Field Values
-
lookupConstructor
private static final java.lang.reflect.Constructor<java.lang.invoke.MethodHandles.Lookup> lookupConstructor
-
privateLookupInMethod
private static final java.lang.reflect.Method privateLookupInMethod
-
sqlSession
private final SqlSession sqlSession
-
mapperInterface
private final java.lang.Class<T> mapperInterface
-
methodCache
private final java.util.Map<java.lang.reflect.Method,MapperProxy.MapperMethodInvoker> methodCache
-
-
Constructor Detail
-
MapperProxy
public MapperProxy(SqlSession sqlSession, java.lang.Class<T> mapperInterface, java.util.Map<java.lang.reflect.Method,MapperProxy.MapperMethodInvoker> methodCache)
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
-
cachedInvoker
private MapperProxy.MapperMethodInvoker cachedInvoker(java.lang.reflect.Method method) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getMethodHandleJava9
private java.lang.invoke.MethodHandle getMethodHandleJava9(java.lang.reflect.Method method) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
-
getMethodHandleJava8
private java.lang.invoke.MethodHandle getMethodHandleJava8(java.lang.reflect.Method method) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
-
-