Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ClassGen.addMethod()


      ProxyImplementationFactory factory =
         new ProxyImplementationFactory(superClassName, proxyClassName, cg);

      cg.addField(factory.createInvocationHandlerField());
      cg.addField(factory.createRuntimeField());
      cg.addMethod(factory.createConstructor());
     
      // ProxyTarget implementation

      cg.addMethod(factory.createGetInvocationHandler());
      cg.addMethod(factory.createGetTargetTypes());
View Full Code Here


      cg.addField(factory.createRuntimeField());
      cg.addMethod(factory.createConstructor());
     
      // ProxyTarget implementation

      cg.addMethod(factory.createGetInvocationHandler());
      cg.addMethod(factory.createGetTargetTypes());
          
      boolean haveToString = false;

      if (trace) log.trace("Creating proxy methods...");
View Full Code Here

      cg.addMethod(factory.createConstructor());
     
      // ProxyTarget implementation

      cg.addMethod(factory.createGetInvocationHandler());
      cg.addMethod(factory.createGetTargetTypes());
          
      boolean haveToString = false;

      if (trace) log.trace("Creating proxy methods...");
View Full Code Here

         org.apache.bcel.classfile.Method proxyMethod =
            factory.createProxyMethod(name, i, rType, pTypes, exceptionNames);

         if (trace) log.trace("Created proxy method: " + proxyMethod);

         cg.addMethod(proxyMethod);
      }

      if (!haveToString) {
         cg.addMethod(factory.createToString());
      }
View Full Code Here

         cg.addMethod(proxyMethod);
      }

      if (!haveToString) {
         cg.addMethod(factory.createToString());
      }

      JavaClass jclass = cg.getJavaClass();
      if (trace) log.trace("Generated Java class: " + jclass);
View Full Code Here

                                           Constants.INVOKESPECIAL));

        il.append(InstructionFactory.createReturn(Type.VOID));
        constructor.setMaxStack();
        constructor.setMaxLocals();
        cg.addMethod(constructor.getMethod());
        il.dispose();

        // build dispatch method
        il = new InstructionList();
View Full Code Here

            gotoInstruction.setTarget(returnInstruction);
        }

        method.setMaxStack();
        method.setMaxLocals();
        cg.addMethod(method.getMethod());
        il.dispose();

        JavaClass jc = cg.getJavaClass();
        OverloadDispatcherClassLoader cl = new OverloadDispatcherClassLoader();
View Full Code Here

                                           Constants.INVOKESPECIAL));

        il.append(InstructionFactory.createReturn(Type.VOID));
        constructor.setMaxStack();
        constructor.setMaxLocals();
        cg.addMethod(constructor.getMethod());
        il.dispose();

        // build clone method
        il = new InstructionList();
        MethodGen method = new MethodGen(Constants.ACC_PUBLIC,
View Full Code Here

        il.append(InstructionFactory.createReturn(Type.OBJECT));
        ifeq_6.setTarget(ih_14);
        ifne_18.setTarget(ih_31);
        method.setMaxStack();
        method.setMaxLocals();
        cg.addMethod(method.getMethod());
        il.dispose();

        JavaClass jc = cg.getJavaClass();
        ClonerClassLoader cl = new ClonerClassLoader();
View Full Code Here

                                           Constants.INVOKESPECIAL));

        il.append(InstructionFactory.createReturn(Type.VOID));
        constructor.setMaxStack();
        constructor.setMaxLocals();
        cg.addMethod(constructor.getMethod());
        il.dispose();

        // build dispatch method
        il = new InstructionList();
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.