return null;
}
static MethodDeclare createAccessor(Member obj) throws InstantiationException, IllegalAccessException {
final String className = "webit.script.asm.Accessor".concat(ASMUtil.getSn());
final ClassWriter classWriter = new ClassWriter(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_FINAL, ASMUtil.getInternalName(className), "java/lang/Object", METHOD_DECLARE);
ASMUtil.visitConstructor(classWriter);
final boolean isInterface;
final boolean isStatic;
final boolean isConstructor;
final String ownerClass;
final String destName;
final String destDesc;
final Class[] paramTypes;
final Class returnType;
if (obj instanceof Method) {
Method method = (Method) obj;
isInterface = method.getDeclaringClass().isInterface();
isStatic = ClassUtil.isStatic(method);
isConstructor = false;
ownerClass = ASMUtil.getInternalName(method.getDeclaringClass().getName());
destName = method.getName();
destDesc = ASMUtil.getDescriptor(method);
paramTypes = method.getParameterTypes();
returnType = method.getReturnType();
} else {
Constructor constructor = (Constructor) obj;
isInterface = false;
isStatic = false;
isConstructor = true;
ownerClass = ASMUtil.getInternalName(constructor.getDeclaringClass().getName());
destName = "<init>";
destDesc = ASMUtil.getDescriptor(constructor);
paramTypes = constructor.getParameterTypes();
returnType = constructor.getDeclaringClass();
}
final int paramTypesLen = paramTypes.length;
final MethodWriter m = classWriter.visitMethod(Constants.ACC_PUBLIC, "invoke", "(Lwebit/script/Context;[Ljava/lang/Object;)Ljava/lang/Object;", null);
if (paramTypesLen == 0) {
if (isStatic) {
m.invokeStatic(ownerClass, destName, destDesc);
ASMUtil.visitBoxIfNeed(m, returnType);