Examples of visitEnd()


Examples of org.objectweb.asm.ClassVisitor.visitEnd()

        m.aload(0);
        m.invokespecial(p(Handle.class), "<init>", sig(void.class));
        m.voidreturn();
        m.end();
       
        cv.visitEnd();
       
        if (debug) {
            ((ASMifierClassVisitor)cv).print(new PrintWriter(System.out));
            return createHandle(classLoader, method, false);
        } else {
View Full Code Here

Examples of org.objectweb.asm.ClassWriter.visitEnd()

            methodVisitor.visitMaxs(0, 0);
            methodVisitor.visitEnd();
            // END public <type> <method>() { return helper.<method>(); }
        }

        visitor.visitEnd();

        byte[] bytecode = visitor.toByteArray();
        return (Class<T>) ReflectionUtil.invoke(type.getClassLoader(), "defineClass", new Object[]{
                typeName, bytecode, 0, bytecode.length
        });
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitEnd()

  public void declareField(BytecodeContextTypeASM context, String name, IBytecodeField field) {
    FieldVisitor fv = context.getClassWriter().visitField(getAccess(field.getAccess()), name, field.getType().toDescriptorString(), null, null);
    for (IBytecodeAnnotation ba : field.getDeclaredAnnotations()) {
      this.declareAnnotation(context, ba, fv.visitAnnotation(ba.getType().getType().toDescriptorString(), true));
    }
    fv.visitEnd();
  }

  public void end(BytecodeContextTypeASM context) {
    context.getClassWriter().visitEnd();
  }
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitEnd()

    if (method instanceof BytecodeMethodConcrete) {
      BytecodeContextMethodASM ctx = new BytecodeContextMethodASM(mv, method, context, writer);
      ((BytecodeMethodConcrete) method).write(ctx);
    } else {
      mv.visitEnd();
    }
  }

  public void declareField(BytecodeContextTypeASM context, String name, IBytecodeField field) {
    FieldVisitor fv = context.getClassWriter().visitField(getAccess(field.getAccess()), name, field.getType().toDescriptorString(), null, null);
View Full Code Here

Examples of org.objectweb.asm.commons.AnalyzerAdapter.visitEnd()

    aa.visitTypeInsn(CHECKCAST, "java/lang/Number");
    aa.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Number", "intValue",
        "()I");
    aa.visitInsn(IRETURN);
    aa.visitMaxs(1, 2);
    aa.visitEnd();
    checkMethod(tmv);
  }

  protected void checkMethod(TraceMethodVisitor tmv) {
    TraceMethodVisitor mv = new TraceMethodVisitor(null);
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.visitEnd()

                mv.visitLocalVariable(var.name, var.desc, var.signature, start, end, var.index);
            }
        }

        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

    /**
     * Gets the method descriptor for the specified name and descriptor.
     * The method descriptor is looked inside the
View Full Code Here

Examples of org.objectweb.asm.signature.SignatureVisitor.visitEnd()

  public static String getClassSignature(TypeToken<?> interfaceType) {
    SignatureWriter signWriter = new SignatureWriter();
    SignatureVisitor sv = signWriter.visitSuperclass();
    sv.visitClassType(Type.getInternalName(Object.class));
    sv.visitEnd();

    SignatureVisitor interfaceVisitor = sv.visitInterface();
    interfaceVisitor.visitClassType(Type.getInternalName(interfaceType.getRawType()));

    if (interfaceType.getType() instanceof ParameterizedType) {
View Full Code Here

Examples of org.objectweb.asm.signature.SignatureWriter.visitEnd()

      for (java.lang.reflect.Type paramType : ((ParameterizedType) fieldType.getType()).getActualTypeArguments()) {
        signWriter.visitTypeArgument(SignatureVisitor.INSTANCEOF);
        visitTypeSignature(fieldType.resolveType(paramType), signWriter);
      }
    }
    signWriter.visitEnd();
    return signWriter.toString();
  }

  public static void visitTypeSignature(TypeToken<?> type, SignatureVisitor visitor) {
    Class<?> rawType = type.getRawType();
View Full Code Here

Examples of org.objectweb.asm.tree.MethodNode.visitEnd()

    mn.visitVarInsn(ILOAD, 1);
    mn.visitInsn(ICONST_0);
    mn.visitInsn(IADD);
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveAddZeroTransformer(null).transform(mn);
    mn.accept(tmv);
    checkMethod(tmv);
  }
View Full Code Here

Examples of org.objectweb.asm.util.CheckClassAdapter.visitEnd()

        null, new Integer(0)).visitEnd();
    cv.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "GREATER", "I",
        null, new Integer(1)).visitEnd();
    cv.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "compareTo",
        "(Ljava/lang/Object;)I", null, null).visitEnd();
    cv.visitEnd();
    byte[] b = cw.toByteArray();
    return b;
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.