|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.asteriskjava.util.ReflectionUtil
public class ReflectionUtil
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.
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. |
static boolean |
isClassAvailable(java.lang.String s)
Checks if the class is available on the current thread's context class loader. |
static java.lang.Object |
newInstance(java.lang.String s)
Creates a new instance of the given class. |
static java.lang.String |
stripIllegalCharacters(java.lang.String s)
Strips all illegal charaters from the given lower case string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.reflect.Method> getGetters(java.lang.Class clazz)
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.
clazz
- the class to return the getters for
public static java.util.Map<java.lang.String,java.lang.reflect.Method> getSetters(java.lang.Class clazz)
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.
clazz
- the class to return the setters for
public static java.lang.String stripIllegalCharacters(java.lang.String s)
s
- the original string
public static boolean isClassAvailable(java.lang.String s)
s
- fully qualified name of the class to check.
true
if the class is available, false
otherwise.public static java.lang.Object newInstance(java.lang.String s)
s
- fully qualified name of the class to instantiate.
null
on failure.
|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |