org.progeeks.util
Class MethodIndex

java.lang.Object
  extended by org.progeeks.util.MethodIndex

public class MethodIndex
extends java.lang.Object

Uses reflections to look-up methods on a class and will cache lookups for faster subsequent access.

Version:
$Revision: 1.1 $
Author:
Paul Speed

Method Summary
 java.lang.reflect.Method findMethod(java.lang.String name, java.lang.Class[] parms)
          Searches for a method matching the specified criteria or returns a previously cached version.
static MethodIndex getMethodIndex(java.lang.Class type)
          Returns a new or previously cached MethodIndex for the specified type.
 java.lang.reflect.Method getPropertyAccessor(java.lang.String name)
          Searches for a property accessor for the spefified property name.
 java.lang.reflect.Method getPropertyMutator(java.lang.String name)
          Returns the "set" method of the specified property.
 java.lang.reflect.Method getPropertyMutator(java.lang.String name, java.lang.Class type)
          Returns the "set" method of the specified property and type.
 java.lang.Class getPropertyType(java.lang.String name)
          Returns the type of the specified property.
static void releaseMethodIndex(java.lang.Class c)
          Releases any cached data associated with the specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMethodIndex

public static MethodIndex getMethodIndex(java.lang.Class type)
Returns a new or previously cached MethodIndex for the specified type.


releaseMethodIndex

public static void releaseMethodIndex(java.lang.Class c)
Releases any cached data associated with the specified class.


getPropertyAccessor

public java.lang.reflect.Method getPropertyAccessor(java.lang.String name)
Searches for a property accessor for the spefified property name.


getPropertyType

public java.lang.Class getPropertyType(java.lang.String name)
Returns the type of the specified property.


getPropertyMutator

public java.lang.reflect.Method getPropertyMutator(java.lang.String name)
Returns the "set" method of the specified property.


getPropertyMutator

public java.lang.reflect.Method getPropertyMutator(java.lang.String name,
                                                   java.lang.Class type)
Returns the "set" method of the specified property and type.


findMethod

public java.lang.reflect.Method findMethod(java.lang.String name,
                                           java.lang.Class[] parms)
Searches for a method matching the specified criteria or returns a previously cached version. If a method matching the description does not exist then a null is returned.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.