View Javadoc
1   package org.pojomatic.internal;
2   
3   import java.lang.invoke.MethodHandles;
4   import java.lang.invoke.MethodHandles.Lookup;
5   
6   public class LookupClassDefiner implements ClassDefiner {
7     private final Lookup lookup = MethodHandles.lookup().dropLookupMode(Lookup.PRIVATE);
8   
9     @Override
10    public Class<?> defineClass(String className, byte[] classBytes) throws IllegalAccessException {
11      return lookup.defineClass(classBytes);
12    }
13  
14  }