org.apache.openejb.util
Class AsmParameterNameLoader

java.lang.Object
  extended by org.apache.openejb.util.AsmParameterNameLoader
All Implemented Interfaces:
org.apache.xbean.recipe.ParameterNameLoader

public class AsmParameterNameLoader
extends java.lang.Object
implements org.apache.xbean.recipe.ParameterNameLoader

Implementation of ParameterNameLoader that uses ASM to read the parameter names from the local variable table in the class byte code.

This wonderful piece of code was taken from org.springframework.core.LocalVariableTableParameterNameDiscover


Constructor Summary
AsmParameterNameLoader()
           
 
Method Summary
 java.util.List<java.lang.String> get(java.lang.reflect.Constructor constructor)
          Gets the parameter names of the specified constructor or null if the class was compiled without debug symbols on.
 java.util.List<java.lang.String> get(java.lang.reflect.Method method)
          Gets the parameter names of the specified method or null if the class was compiled without debug symbols on.
 java.util.Map<java.lang.reflect.Constructor,java.util.List<java.lang.String>> getAllConstructorParameters(java.lang.Class clazz)
          Gets the parameter names of all constructoror null if the class was compiled without debug symbols on.
 java.util.Map<java.lang.reflect.Method,java.util.List<java.lang.String>> getAllMethodParameters(java.lang.Class clazz, java.lang.String methodName)
          Gets the parameter names of all methods with the specified name or null if the class was compiled without debug symbols on.
static void install()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsmParameterNameLoader

public AsmParameterNameLoader()
Method Detail

install

public static void install()

get

public java.util.List<java.lang.String> get(java.lang.reflect.Method method)
Gets the parameter names of the specified method or null if the class was compiled without debug symbols on.

Specified by:
get in interface org.apache.xbean.recipe.ParameterNameLoader
Parameters:
method - the method for which the parameter names should be retrieved
Returns:
the parameter names or null if the class was compilesd without debug symbols on

get

public java.util.List<java.lang.String> get(java.lang.reflect.Constructor constructor)
Gets the parameter names of the specified constructor or null if the class was compiled without debug symbols on.

Specified by:
get in interface org.apache.xbean.recipe.ParameterNameLoader
Parameters:
constructor - the constructor for which the parameters should be retrieved
Returns:
the parameter names or null if the class was compiled without debug symbols on

getAllConstructorParameters

public java.util.Map<java.lang.reflect.Constructor,java.util.List<java.lang.String>> getAllConstructorParameters(java.lang.Class clazz)
Gets the parameter names of all constructoror null if the class was compiled without debug symbols on.

Parameters:
clazz - the class for which the constructor parameter names should be retrieved
Returns:
a map from Constructor object to the parameter names or null if the class was compiled without debug symbols on

getAllMethodParameters

public java.util.Map<java.lang.reflect.Method,java.util.List<java.lang.String>> getAllMethodParameters(java.lang.Class clazz,
                                                                                                       java.lang.String methodName)
Gets the parameter names of all methods with the specified name or null if the class was compiled without debug symbols on.

Parameters:
clazz - the class for which the method parameter names should be retrieved
methodName - the of the method for which the parameters should be retrieved
Returns:
a map from Method object to the parameter names or null if the class was compiled without debug symbols on


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.