ch.ralscha.extdirectspring.util
Enum MethodInfoCache

java.lang.Object
  extended by java.lang.Enum<MethodInfoCache>
      extended by ch.ralscha.extdirectspring.util.MethodInfoCache
All Implemented Interfaces:
Serializable, Comparable<MethodInfoCache>

public enum MethodInfoCache
extends Enum<MethodInfoCache>

A simple cache for methods with key beanName/methodName

Author:
Ralph Schaer

Enum Constant Summary
INSTANCE
          Singleton enum pattern
 
Method Summary
 MethodInfo get(String beanName, String methodName)
          Get a method from the MethodCache.
 MethodInfo put(String beanName, String methodName, Method method)
          Put a method into the MethodCache.
static MethodInfoCache valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MethodInfoCache[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final MethodInfoCache INSTANCE
Singleton enum pattern

Method Detail

values

public static MethodInfoCache[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MethodInfoCache c : MethodInfoCache.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MethodInfoCache valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

put

public MethodInfo put(String beanName,
                      String methodName,
                      Method method)
Put a method into the MethodCache.

Parameters:
beanName - the name of the bean
methodName - the name of the method
method - the method
Returns:
the methodInfo object of the method

get

public MethodInfo get(String beanName,
                      String methodName)
Get a method from the MethodCache.

Parameters:
beanName - the name of the bean
methodName - the name of the method
Returns:
the found methodInfo object, null if there is no method found in the cache


Copyright © 2010. All Rights Reserved.