Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.InstructionList.dispose()


       iList.append( InstructionFactory.createReturn( Type.getReturnType( sig ) ) );
      
       mGen.setMaxStack();
       mGen.setMaxLocals();
       cGen.addMethod( mGen.getMethod() );
       iList.dispose();
   }
  
   
}
View Full Code Here


        il.append(factory.createInvoke(fullSuperclassName, "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
        il.append(InstructionFactory.createReturn(Type.VOID));
        method.setMaxStack();
        method.setMaxLocals();
        classGen.addMethod(method.getMethod());
        il.dispose();
    }

    /**
     * Create a getter method for a /property.
     * @param mmd MetaData for the property
View Full Code Here

        il.append(factory.createFieldAccess(this.fullClassName, mmd.getName(), objectType, Constants.GETFIELD));
        il.append(InstructionFactory.createReturn(objectType));
        method.setMaxStack();
        method.setMaxLocals();
        classGen.addMethod(method.getMethod());
        il.dispose();
    }

    /**
     * Create a setter method for a property.
     * @param mmd MetaData for the property
View Full Code Here

        il.append(factory.createFieldAccess(this.fullClassName, mmd.getName(), objectType, Constants.PUTFIELD));
        il.append(InstructionFactory.createReturn(Type.VOID));
        method.setMaxStack();
        method.setMaxLocals();
        classGen.addMethod(method.getMethod());
        il.dispose();
    }
}
View Full Code Here

                    int newIndex = cp.addClass(newClass);
                    cfr.setClassIndex(newIndex);
                }
            }
        }
        il.dispose();
        return mg.getMethod();
    }

    /**
        Delete all constructors of a class.  Leave one default, do-nothing constructor.
View Full Code Here

        il.append(InstructionConstants.ARETURN);

        mg.setMaxStack();
        classGen.addMethod(mg.getMethod());
        il.dispose();
    }

    private static void closeSafely(ByteArrayOutputStream out)
    {
        if (out != null)
View Full Code Here

    il.append(_factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
    InstructionHandle ih_4 = il.append(_factory.createReturn(Type.VOID));
    method.setMaxStack();
    method.setMaxLocals();
    _cg.addMethod(method.getMethod());
    il.dispose();
  }

}
View Full Code Here

        methodGen.setMaxStack();
        methodGen.setMaxLocals();

        TransformationUtil.addMethod(cg, methodGen.getMethod());
        il.dispose();
    }

    /**
     * Checks if a method is static or not.
     *
 
View Full Code Here

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

        // build dispatch method
        il = new InstructionList();

        Type[] dispatchArgumentTypes = null;
View Full Code Here

        }

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

        JavaClass jc = cg.getJavaClass();
        OverloadDispatcherClassLoader cl = new OverloadDispatcherClassLoader();

        // debug
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.