Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.InstructionFactory.createInvoke()


           Constants.INVOKEVIRTUAL));
    il.append(factory.createInvoke("java.lang.StringBuffer", "toString",
           Type.STRING, Type.NO_ARGS,
           Constants.INVOKEVIRTUAL));
   
    il.append(factory.createInvoke("java.io.PrintStream", "println",
           Type.VOID, new Type[] { Type.STRING },
           Constants.INVOKEVIRTUAL));

    il.append(InstructionConstants.RETURN);
View Full Code Here


      // System.out.println("actionPerformed:" + event);
      il.append(new GETSTATIC(out));
      il.append(factory.createNew("java.lang.StringBuffer"));
      il.append(InstructionConstants.DUP);
      il.append(new PUSH(cp, "actionPerformed:"));
      il.append(factory.createInvoke("java.lang.StringBuffer", "<init>", Type.VOID,
             new Type[] {Type.STRING}, Constants.INVOKESPECIAL));

      il.append(new ALOAD(1));
      il.append(factory.createAppend(Type.OBJECT));
      il.append(new INVOKEVIRTUAL(println));
View Full Code Here

      // 'this' is created above, to close the last branch
      implementation.append(factory.createLoad(metadataType, 1));
      implementation.append(factory.createLoad(Type.STRING, 2));
      implementation.append(factory.createLoad(new ArrayType(Type.STRING, 1), 3));
      implementation.append(factory.createLoad(new ArrayType(Type.OBJECT, 1), 4));
      implementation.append(factory.createInvoke(BCELMBeanInvoker.class.getName(), "invokeImpl", Type.OBJECT, signature, Constants.INVOKESPECIAL));
      implementation.append(factory.createReturn(Type.OBJECT));

      mthd.setMaxStack();

      org.apache.bcel.classfile.Method method = mthd.getMethod();
View Full Code Here

       iList.append( InstructionFactory.createLoad( Type.OBJECT, 0 ) );
      
       iList.append( factory.createNew( implClass.getName() ) );
       iList.append( InstructionConstants.DUP );
       iList.append(
           factory.createInvoke(
               implClass.getName(),
               Constants.CONSTRUCTOR_NAME,
               Type.VOID, Type.NO_ARGS,
               Constants.INVOKESPECIAL ) );
      
View Full Code Here

      
       // use a factory if the implementation class is a factory
       if( MixInImplementationFactory.class.isAssignableFrom( implClass ) ) {

           iList.append(
               factory.createInvoke(
                       implClass.getName(),
                       "getInstance",
                       Type.OBJECT,
                       Type.NO_ARGS, Constants.INVOKEVIRTUAL ) );
          
View Full Code Here

      
       // get the delegate
       iList.append( InstructionFactory.createLoad( Type.OBJECT, 0 ) );

       iList.append(
           factory.createInvoke(
               cGen.getClassName(),
               getterMethodName,
               Type.getType( interfaceClass ),
               Type.NO_ARGS,
               Constants.INVOKESPECIAL ) );
View Full Code Here

          
       }

       // do the delegation
       iList.append(
           factory.createInvoke(
               interfaceClass.getName(),
               m.getName(),
               Type.getReturnType( sig ),
               Type.getArgumentTypes( sig ),
               Constants.INVOKEINTERFACE ) );
View Full Code Here

            int svUidIndex = constantPoolGen.addLong(addSerialVersionUID);
            il.append(new LDC2_W(svUidIndex));
            il.append(factory.createPutStatic(className, FN_serialVersionUID, Type.LONG));
        }
        // field init MN_jdoFieldNamesInit
        il.append(factory.createInvoke(className, MN_FieldNamesInitMethod, new ArrayType(Type.STRING, 1), Type.NO_ARGS,
            Constants.INVOKESTATIC));
        il.append(factory.createPutStatic(className, FN_FieldNames, new ArrayType(Type.STRING, 1)));

        // field init MN_jdoFieldTypesInit
        il.append(factory.createInvoke(className, MN_FieldTypesInitMethod, new ArrayType(OT_CLASS, 1), Type.NO_ARGS, Constants.INVOKESTATIC));
View Full Code Here

        il.append(factory.createInvoke(className, MN_FieldNamesInitMethod, new ArrayType(Type.STRING, 1), Type.NO_ARGS,
            Constants.INVOKESTATIC));
        il.append(factory.createPutStatic(className, FN_FieldNames, new ArrayType(Type.STRING, 1)));

        // field init MN_jdoFieldTypesInit
        il.append(factory.createInvoke(className, MN_FieldTypesInitMethod, new ArrayType(OT_CLASS, 1), Type.NO_ARGS, Constants.INVOKESTATIC));
        il.append(factory.createPutStatic(className, FN_FieldTypes, new ArrayType(OT_CLASS, 1)));

        // field init MN_FieldFlagsInitMethod
        il.append(factory.createInvoke(className, MN_FieldFlagsInitMethod, new ArrayType(Type.BYTE, 1), Type.NO_ARGS,
            Constants.INVOKESTATIC));
View Full Code Here

        // field init MN_jdoFieldTypesInit
        il.append(factory.createInvoke(className, MN_FieldTypesInitMethod, new ArrayType(OT_CLASS, 1), Type.NO_ARGS, Constants.INVOKESTATIC));
        il.append(factory.createPutStatic(className, FN_FieldTypes, new ArrayType(OT_CLASS, 1)));

        // field init MN_FieldFlagsInitMethod
        il.append(factory.createInvoke(className, MN_FieldFlagsInitMethod, new ArrayType(Type.BYTE, 1), Type.NO_ARGS,
            Constants.INVOKESTATIC));
        il.append(factory.createPutStatic(className, FN_FieldFlags, new ArrayType(Type.BYTE, 1)));

        // field init MN_JdoFieldCounInitMethod
        il.append(factory.createInvoke(className, MN_JdoGetInheritedFieldCount, Type.INT, Type.NO_ARGS, Constants.INVOKESTATIC));
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.