Package org.objectweb.asm

Examples of org.objectweb.asm.MethodAdapter


    };
  }

  public MethodVisitor visitMethod(final int access, final String methodName,
      final String desc, final String signature, final String[] exceptions) {
    return new MethodAdapter(EMPTY_VISITOR) {

      Map<String,Annotation> ma = new HashMap<String,Annotation>();
      ArrayList<Map<String, Annotation>> pa = new ArrayList<Map<String, Annotation>>();

      public AnnotationVisitor visitAnnotationDefault() {
View Full Code Here


      return EMPTY_VISITOR;
    }

    public MethodVisitor visitMethod(final int access, final String methodName,
        final String desc, final String signature, final String[] exceptions) {
      return new MethodAdapter(EMPTY_VISITOR) {

        public AnnotationVisitor visitAnnotationDefault() {
          // remove leading ()
          String type = desc.substring(2);
View Full Code Here

            ClassReader cr = new ClassReader(bytes);
            ClassWriter cw = new ClassWriter(false, true);
            cr.accept(
                    new ClassAdapter(cw) {
                        public MethodVisitor visitMethod(int access, final String name, String desc, String signature, String[] exceptions) {
                            return new MethodAdapter(super.visitMethod(access, name, desc, signature, exceptions)) {
                                public AnnotationVisitor visitAnnotationDefault() {
                                    return new DefaultAnnotationBuilderVisitor(newDefaults, name);
                                }
                            };
                        }
View Full Code Here

    @Override
    public MethodVisitor visitMethod(int access, String name, String desc,
        String signature, String[] exceptions) {
      final MethodVisitor mv = super.visitMethod(access, name, desc,
          signature, exceptions);
      return new MethodAdapter(mv) {
        @Override
        public void visitMaxs(int maxStack, int maxLocals) {
          super.visitMaxs(-1, maxLocals);
        }
      };
View Full Code Here

    @Override
    public MethodVisitor visitMethod(int access, String name, String desc,
        String signature, String[] exceptions) {
      final MethodVisitor mv = super.visitMethod(access, name, desc,
          signature, exceptions);
      return new MethodAdapter(mv) {
        @Override
        public void visitMaxs(int maxStack, int maxLocals) {
          super.visitMaxs(-1, maxLocals);
        }
      };
View Full Code Here

        TODO(mmirabelli): find how to change the access of the default
        constructor, since that it seems to be private by default in a private
        class. It cause this assembly to break in private inner classes, unless
        an explicit public constructor will be defined.
       */
      mv = new MethodAdapter(mv) {
        private boolean alreadySet = false;

        @Override
        public void visitMethodInsn(final int opcode, final String klass, final String method,
            final String desc) {
View Full Code Here

                MethodVisitor v = cv.visitMethod(access,
                        name,
                        desc,
                        signature,
                        exceptions);
                return new MethodAdapter(v) {

                    private final List params = new ArrayList();

                    public AnnotationVisitor visitParameterAnnotation(
                        final int parameter,
View Full Code Here

            final String name,
            final String desc,
            final String signature,
            final String[] exceptions)
        {
            return new MethodAdapter(super.visitMethod(access,
                    name,
                    desc,
                    signature,
                    exceptions))
            {
View Full Code Here

            final String name,
            final String desc,
            final String signature,
            final String[] exceptions)
        {
            return new MethodAdapter(super.visitMethod(access,
                    name,
                    desc,
                    signature,
                    exceptions))
            {
View Full Code Here

    public void testAcceptor1() {
        l1.add(new InsnNode(55));
        l1.add(new InsnNode(77));
       
        final InsnList lst = new InsnList();
        l1.accept(new MethodAdapter(null) {
            public void visitInsn(int opcode) {
                lst.add(new InsnNode(opcode));
            }
        });
       
View Full Code Here

TOP

Related Classes of org.objectweb.asm.MethodAdapter

Copyright © 2018 www.massapicom. 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.