org.exolab.jmscts.core
Class MethodCache
java.lang.Object
|
+--org.exolab.jmscts.core.MethodCache
- public class MethodCache
- extends java.lang.Object
Helper for caching the methods of a class to avoid expensive
Class.getDeclaredMethods()
and Class.getMethod(java.lang.String, java.lang.Class[])
calls
- Version:
- $Revision: 1.2 $ $Date: 2004/01/31 13:44:24 $
- Author:
- Tim Anderson
Constructor Summary |
MethodCache(java.lang.Class type)
Cache all public methods for the specified class type |
Method Summary |
java.lang.reflect.Method |
getMethod(java.lang.String name)
Get the named method. |
java.lang.reflect.Method |
getMethod(java.lang.String name,
int args)
Get the named method, with the specified number of arguments. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodCache
public MethodCache(java.lang.Class type)
- Cache all public methods for the specified class type
- Parameters:
type
- the class type to cache methods for
getMethod
public java.lang.reflect.Method getMethod(java.lang.String name)
throws java.lang.NoSuchMethodException
- Get the named method. If more than one method exists with the same
name, the first will be returned
- Parameters:
name
- the name of the method- Returns:
- the first method matching name
- Throws:
java.lang.NoSuchMethodException
- if the method doesn't exist
getMethod
public java.lang.reflect.Method getMethod(java.lang.String name,
int args)
throws java.lang.NoSuchMethodException
- Get the named method, with the specified number of arguments.
If more than one method exists the first will be returned
- Parameters:
name
- the name of the methodargs
- the number of arguments- Returns:
- the first method matching name
- Throws:
java.lang.NoSuchMethodException
- if the method doesn't exist
Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.