public void end_class() { if (!TypeUtils.isInterface(access)) { try { generate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } super.end_class(); }
public void end_class() { if (!TypeUtils.isInterface(access)) { try { generate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } super.end_class(); }
public void begin_class(int version, int access, String className, Type superType, Type[] interfaces, String sourceFile) { if(!TypeUtils.isInterface(access)){ Type[] all = TypeUtils.add(interfaces, TypeUtils.getTypes(delegateIf)); super.begin_class(version, access, className, superType, all, sourceFile); declare_field(Constants.ACC_PRIVATE | Constants.ACC_TRANSIENT, DELEGATE, delegateType, null); for (int i = 0; i < delegateIf.length; i++) { Method[] methods = delegateIf[i].getMethods(); for (int j = 0; j < methods.length; j++) { if (Modifier.isAbstract(methods[j].getModifiers())) { addDelegate(methods[j]); } } } }else{ super.begin_class(version, access, className, superType, interfaces, sourceFile); } }
protected void init() { if (!TypeUtils.isInterface(getAccess())) { CodeEmitter e = getStaticHook(); EmitUtils.load_class_this(e); e.invoke(info); } } }
public CodeEmitter getStaticHook() { if (TypeUtils.isInterface(getAccess())) { throw new IllegalStateException("static hook is invalid for this class"); } if (staticHook == null) { staticHookSig = new Signature("CGLIB$STATICHOOK" + getNextHook(), "()V"); staticHook = begin_method(Constants.ACC_STATIC, staticHookSig, null); if (staticInit != null) { staticInit.invoke_static_this(staticHookSig); } } return staticHook; }
public CodeEmitter getStaticHook() { if (TypeUtils.isInterface(getAccess())) { throw new IllegalStateException("static hook is invalid for this class"); } if (staticHook == null) { staticHookSig = new Signature("CGLIB$STATICHOOK" + getNextHook(), "()V"); staticHook = begin_method(Constants.ACC_STATIC, staticHookSig, null); if (staticInit != null) { staticInit.invoke_static_this(staticHookSig); } } return staticHook; }
protected void init() { if (!TypeUtils.isInterface(getAccess())) { CodeEmitter e = getStaticHook(); EmitUtils.load_class_this(e); e.invoke(info); } } }
public void begin_class(int version, int access, String className, Type superType, Type[] interfaces, String sourceFile) { if(!TypeUtils.isInterface(access)){ Type[] all = TypeUtils.add(interfaces, TypeUtils.getTypes(delegateIf)); super.begin_class(version, access, className, superType, all, sourceFile); declare_field(Constants.ACC_PRIVATE | Constants.ACC_TRANSIENT, DELEGATE, delegateType, null); for (int i = 0; i < delegateIf.length; i++) { Method[] methods = delegateIf[i].getMethods(); for (int j = 0; j < methods.length; j++) { if (Modifier.isAbstract(methods[j].getModifiers())) { addDelegate(methods[j]); } } } }else{ super.begin_class(version, access, className, superType, interfaces, sourceFile); } }
public void invoke(MethodInfo method, Type virtualType) { ClassInfo classInfo = method.getClassInfo(); Type type = classInfo.getType(); Signature sig = method.getSignature(); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { invoke_constructor(type, sig); } else if (TypeUtils.isInterface(classInfo.getModifiers())) { invoke_interface(type, sig); } else if (TypeUtils.isStatic(method.getModifiers())) { invoke_static(type, sig); } else { invoke_virtual(virtualType, sig); } }
public void invoke(MethodInfo method, Type virtualType) { ClassInfo classInfo = method.getClassInfo(); Type type = classInfo.getType(); Signature sig = method.getSignature(); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { invoke_constructor(type, sig); } else if (TypeUtils.isInterface(classInfo.getModifiers())) { invoke_interface(type, sig); } else if (TypeUtils.isStatic(method.getModifiers())) { invoke_static(type, sig); } else { invoke_virtual(virtualType, sig); } }
null, TypeUtils.toInternalNames(exceptions)); if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(getAccess())) { rawStaticInit = v; MethodVisitor wrapped = new MethodVisitor(Constants.ASM_API, v) {
null, TypeUtils.toInternalNames(exceptions)); if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(getAccess())) { rawStaticInit = v; MethodVisitor wrapped = new MethodVisitor(Constants.ASM_API, v) {
public void begin_class(int version, int access, String className, Type superType, Type[] interfaces, String sourceFile) { if (!TypeUtils.isInterface(access)) { super.begin_class(version, access, className, superType, TypeUtils.add(interfaces, ENABLED), sourceFile); super.declare_field(Constants.ACC_PRIVATE | Constants.ACC_TRANSIENT, CALLBACK_FIELD, CALLBACK, null); CodeEmitter e; e = super.begin_method(Constants.ACC_PUBLIC, ENABLED_GET, null); e.load_this(); e.getfield(CALLBACK_FIELD); e.return_value(); e.end_method(); e = super.begin_method(Constants.ACC_PUBLIC, ENABLED_SET, null); e.load_this(); e.load_arg(0); e.putfield(CALLBACK_FIELD); e.return_value(); e.end_method(); } else { super.begin_class(version, access, className, superType, interfaces, sourceFile); } }
public void begin_class(int version, int access, String className, Type superType, Type[] interfaces, String sourceFile) { if (!TypeUtils.isInterface(access)) { super.begin_class(version, access, className, superType, TypeUtils.add(interfaces, ENABLED), sourceFile); super.declare_field(Constants.ACC_PRIVATE | Constants.ACC_TRANSIENT, CALLBACK_FIELD, CALLBACK, null); CodeEmitter e; e = super.begin_method(Constants.ACC_PUBLIC, ENABLED_GET, null); e.load_this(); e.getfield(CALLBACK_FIELD); e.return_value(); e.end_method(); e = super.begin_method(Constants.ACC_PUBLIC, ENABLED_SET, null); e.load_this(); e.load_arg(0); e.putfield(CALLBACK_FIELD); e.return_value(); e.end_method(); } else { super.begin_class(version, access, className, superType, interfaces, sourceFile); } }
public void end_class() { if (!TypeUtils.isInterface(access)) { try { generate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } super.end_class(); }
public void end_class() { if (!TypeUtils.isInterface(access)) { try { generate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } super.end_class(); }
public void end_class() { if (!TypeUtils.isInterface(access)) { try { generate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } } super.end_class(); }
protected void init() { if (!TypeUtils.isInterface(getAccess())) { CodeEmitter e = getStaticHook(); EmitUtils.load_class_this(e); e.invoke(info); } } }
protected void init() { if (!TypeUtils.isInterface(getAccess())) { CodeEmitter e = getStaticHook(); EmitUtils.load_class_this(e); e.invoke(info); } } }
protected void init() { if (!TypeUtils.isInterface(getAccess())) { CodeEmitter e = getStaticHook(); EmitUtils.load_class_this(e); e.invoke(info); } } }