org.jboss.weld.util.bytecode
Class MethodUtils

java.lang.Object
  extended by org.jboss.weld.util.bytecode.MethodUtils

public class MethodUtils
extends Object

Utility class for working with methods

Author:
Stuart Douglas

Method Summary
static int calculateMaxLocals(Method method)
          Calculates maxLocals required to hold all parameters and this, assuming that user code does not require any extra variables
static javassist.bytecode.MethodInfo makeMethod(MethodInformation methodInfo, Class<?>[] exceptions, javassist.bytecode.Bytecode body, javassist.bytecode.ConstPool pool)
          Creates a MethodInfo from the given information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeMethod

public static javassist.bytecode.MethodInfo makeMethod(MethodInformation methodInfo,
                                                       Class<?>[] exceptions,
                                                       javassist.bytecode.Bytecode body,
                                                       javassist.bytecode.ConstPool pool)
Creates a MethodInfo from the given information. This method must be added to the ClassFile manually

Parameters:
methodInfo - The method information
exceptions - checked exceptions thrown by the method
body - the method bytecode. This must have the correct value for maxLocals already set
pool - the const pool
Returns:
the created method

calculateMaxLocals

public static int calculateMaxLocals(Method method)
Calculates maxLocals required to hold all parameters and this, assuming that user code does not require any extra variables



Copyright © 2013 Seam Framework. All Rights Reserved.