Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.Method


            null, cpg.getConstantPool()));
    dups.add(varRef);
      }
  }

  Method init = compileInit(sortObjects, sortRecord,
           cpg, className);
  Method extract = compileExtract(sortObjects, sortRecord,
          cpg, className);
  sortRecord.addMethod(init);
  sortRecord.addMethod(extract);

  xsltc.dumpClass(sortRecord.getJavaClass());
View Full Code Here


            null, cpg.getConstantPool()));
    dups.add(varRef);
      }
  }

  Method clinit = compileClassInit(sortObjects, sortRecord,
           cpg, className);
  Method extract = compileExtract(sortObjects, sortRecord,
          cpg, className);
  sortRecord.addMethod(clinit);
  sortRecord.addEmptyConstructor(ACC_PUBLIC);
  sortRecord.addMethod(extract);
View Full Code Here

            null, cpg.getConstantPool()));
    dups.add(varRef);
      }
  }

  Method init = compileInit(sortObjects, sortRecord,
           cpg, className);
  Method extract = compileExtract(sortObjects, sortRecord,
          cpg, className);
  sortRecord.addMethod(init);
  sortRecord.addMethod(extract);

  xsltc.dumpClass(sortRecord.getJavaClass());
View Full Code Here

            variables[i].setEnd(end);
        }

        _methodGen.setMaxStack();

        Method m = _methodGen.getMethod();

        _classGen.addMethod(m);
    }
View Full Code Here

     */
    private List getAroundAdviceInfo(final JavaClass javaClass) {
        List advice = new ArrayList();
        Method[] methods = javaClass.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            String adviceName = method.getName();
            if (adviceName.startsWith(PREFIX_AROUND_ADVICE) && !adviceName.endsWith(PROCEED_SUFFIX)) {
                advice.add(createAdviceInfo(javaClass, AdviceType.AROUND, method));
            }
        }
        return advice;
View Full Code Here

     */
    private List getBeforeAdviceInfo(final JavaClass javaClass) {
        List advice = new ArrayList();
        Method[] methods = javaClass.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            String adviceName = method.getName();
            if (adviceName.startsWith(PREFIX_BEFORE_ADVICE)) {
                advice.add(createAdviceInfo(javaClass, AdviceType.BEFORE, method));
            }
        }
        return advice;
View Full Code Here

     */
    private List getAfterFinallyAdviceInfo(final JavaClass javaClass) {
        List advice = new ArrayList();
        Method[] methods = javaClass.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            String adviceName = method.getName();
            if (adviceName.startsWith(PREFIX_AFTER_FINALLY_ADVICE)) {
                advice.add(createAdviceInfo(javaClass, AdviceType.AFTER_FINALLY, method));
            }
        }
        return advice;
View Full Code Here

     */
    private List getAfterThrowingAdviceInfo(final JavaClass javaClass) {
        List advice = new ArrayList();
        Method[] methods = javaClass.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            String adviceName = method.getName();
            if (adviceName.startsWith(PREFIX_AFTER_THROWING_ADVICE)) {
                advice.add(createAdviceInfo(javaClass, AdviceType.AFTER_THROWING, method));
            }
        }
        return advice;
View Full Code Here

     */
    private List getAfterReturningAdviceInfo(final JavaClass javaClass) {
        List advice = new ArrayList();
        Method[] methods = javaClass.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            String adviceName = method.getName();
            if (adviceName.startsWith(PREFIX_AFTER_RETURNING_ADVICE)) {
                advice.add(createAdviceInfo(javaClass, AdviceType.AFTER_RETURNING, method));
            }
        }
        return advice;
View Full Code Here

                // what now?
            }
        }

        Method[] methods = bclass.getMethods();
        Method method = null;
        // Get the BCEL Method corresponding to the
        // ava.lang.reflect.Method
        for (int i = 0; i < methods.length; i++) {
            if (m.getName().equals(methods[i].getName()) &&
                    getSignature(m).equals(methods[i].getSignature())) {
                method = methods[i];
                break;
            }
        }

        // Obtain the exact method we're interested in.
        if (method == null)
            return null;

        // Get the Code object, which contains the local variable table.
        Code code = method.getCode();
        if (code == null)
            return null;

        LocalVariableTable attr = method.getLocalVariableTable();
        if (attr == null)
            return null;

        // OK, found it.  Now scan through the local variables and record
        // the names in the right indices.
View Full Code Here

TOP

Related Classes of org.apache.bcel.classfile.Method

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.