FileDocCategorySizeDatePackage
JavaMethod.javaAPI DocApache Axis 1.42005Sat Apr 22 18:57:26 BST 2006org.apache.axis.utils.cache

JavaMethod

public class JavaMethod extends Object
A simple cache of previously loaded methods
author
Sam Ruby

Fields Summary
private Method[]
methods
Constructors Summary
public JavaMethod(Class jc, String name)
Create a cache entry for this java.lang.Class

param
jc java.lang.Class which will be searched for methods
param
name name of the method


                               
         
        Method[] methods = jc.getMethods();
        Vector workinglist = new Vector();

        // scan for matching names, saving the match if it is unique,
        // otherwise accumulating a list
        for (int i=0; i<methods.length; i++) {
            if (methods[i].getName().equals(name)) {
                workinglist.addElement(methods[i]);
            }
        }

        // If a list was found, convert it into an array
        if (workinglist.size() > 0) {
            this.methods = new Method[workinglist.size()];
            workinglist.copyInto(this.methods);
        }
    
Methods Summary
public java.lang.reflect.Method[]getMethod()
Lookup a method based on name. This method returns an array just in case there is more than one.

param
name name of method

        return methods;