Class CodeGenProjectionProvider

java.lang.Object
net.binis.codegen.projection.provider.CodeGenProjectionProvider
All Implemented Interfaces:
net.binis.codegen.factory.ProjectionProvider, net.binis.codegen.factory.ProxyProvider

public class CodeGenProjectionProvider extends Object implements net.binis.codegen.factory.ProjectionProvider, net.binis.codegen.factory.ProxyProvider
  • Field Details

  • Constructor Details

    • CodeGenProjectionProvider

      public CodeGenProjectionProvider()
  • Method Details

    • create

      public net.binis.codegen.factory.ProjectionInstantiation create(Class<?> cls, Class<?>... projections)
      Specified by:
      create in interface net.binis.codegen.factory.ProjectionProvider
    • createObject

      protected Constructor<?> createObject(Class<?> cls, Class<?>[] projections)
    • createProjectionClass

      protected Class<?> createProjectionClass(Class<?> cls, Class<?>[] projections)
    • handleInterface

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleInterface(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Class<?> cls, Class<?> intf, String desc, Map<String,List<Class<?>[]>> methods)
    • handleMethod

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleMethod(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Class<?> cls, Method mtd, String desc, Map<String,List<Class<?>[]>> methods)
    • handleUndeclaredMethod

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleUndeclaredMethod(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Method mtd, Class<?>[] types, Class<?> ret, boolean isVoid)
    • handleDeclaredMethod

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleDeclaredMethod(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Method mtd, Method m, String desc, Class<?>[] types, Class<?> ret)
    • handlePath

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handlePath(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Class<?> cls, Method mtd, String desc, Class<?>[] types, Class<?> ret, boolean isVoid, Deque<Method> path)
    • handleProjection

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleProjection(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Method mtd, Method m, String desc, Class<?>[] types, Class<?> ret)
    • handleCustomClassProjection

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> handleCustomClassProjection(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Method mtd, Method m, String desc, Class<?>[] types, Class<?> ret, Type[] generics)
    • needProjection

      protected boolean needProjection(Type[] generics, Type[] original)
    • calcDescriptor

      protected String calcDescriptor(Class<?>[] types, Class<?> returnType)
    • getPrimitiveDescriptor

      protected char getPrimitiveDescriptor(Class<?> type)
    • getLoadOpcode

      protected int getLoadOpcode(Class<?> type)
    • getReturnOpcode

      protected net.binis.codegen.objects.Pair<Integer,Integer> getReturnOpcode(Class<?> type)
    • getLoadOffset

      protected int getLoadOffset(Class<?> type)
    • loadParams

      protected int loadParams(net.bytebuddy.jar.asm.MethodVisitor methodVisitor, Class<?>[] types)
    • loadOffset

      protected int loadOffset(Class<?>[] types)
    • methodExists

      protected boolean methodExists(Map<String,List<Class<?>[]>> methods, Method mtd, Class<?>[] types)
    • paramsMatch

      protected boolean paramsMatch(Class<?>[] types, Class<?>[] t)
    • checkPath

      protected net.bytebuddy.dynamic.DynamicType.Builder<?> checkPath(net.bytebuddy.dynamic.DynamicType.Builder<?> type, Class<?> cls, Method mtd, String desc, Class<?>[] types, Class<?> ret, boolean isVoid)
    • findMethod

      protected Method findMethod(Class<?> cls, String name, Class<?>[] types) throws NoSuchMethodException
      Throws:
      NoSuchMethodException
    • findStartMethod

      protected void findStartMethod(Class<?> cls, String name, Class<?>[] types, Deque<Method> path)
    • calcGetterName

      protected String calcGetterName(String value)
    • defaultReturn

      protected static void defaultReturn(net.bytebuddy.jar.asm.MethodVisitor methodVisitor, Class<?> ret)
    • proxy

      public Object proxy(Class cls, InvocationHandler handler)
      Specified by:
      proxy in interface net.binis.codegen.factory.ProxyProvider