Asterisk-Java

org.asteriskjava.util
Class ReflectionUtil

java.lang.Object
  extended by org.asteriskjava.util.ReflectionUtil

public class ReflectionUtil
extends java.lang.Object

Utility class that provides helper methods for reflection that is used by the fastagi and manager packages to access getter and setter methods.

Client code is not supposed to use this class.

Author:
srt

Method Summary
static java.util.Map<java.lang.String,java.lang.reflect.Method> getGetters(java.lang.Class clazz)
          Returns a Map of getter methods of the given class.
static java.util.Map<java.lang.String,java.lang.reflect.Method> getSetters(java.lang.Class clazz)
          Returns a Map of setter methods of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGetters

public static java.util.Map<java.lang.String,java.lang.reflect.Method> getGetters(java.lang.Class clazz)
Returns a Map of getter methods of the given class.

The key of the map contains the name of the attribute that can be accessed by the getter, the value the getter itself (an instance of java.lang.reflect.Method). A method is considered a getter if its name starts with "get", it is declared public and takes no arguments.

Parameters:
clazz - the class to return the getters for
Returns:
a Map of attributes and their accessor methods (getters)

getSetters

public static java.util.Map<java.lang.String,java.lang.reflect.Method> getSetters(java.lang.Class clazz)
Returns a Map of setter methods of the given class.

The key of the map contains the name of the attribute that can be accessed by the setter, the value the setter itself (an instance of java.lang.reflect.Method). A method is considered a setter if its name starts with "set", it is declared public and takes exactly one argument.

Parameters:
clazz - the class to return the setters for
Returns:
a Map of attributes and their accessor methods (setters)

Asterisk-Java

Copyright © 2004-2007 Stefan Reuter. All Rights Reserved.