|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.smslib.helper.ReflectionHelper
public class ReflectionHelper
Some methods to use generics with reflection.
Constructor Summary | |
---|---|
ReflectionHelper()
|
Method Summary | ||
---|---|---|
static java.lang.reflect.Method |
getMethodOnlyByName(java.lang.Class<?> c,
java.lang.String methodName)
Searches in the given class for the given method name. |
|
static
|
invokeAndCast(T returnType,
java.lang.reflect.Method m,
java.lang.Object obj,
java.lang.Object... args)
Invokes the given method on the given object with the given arguments. |
|
static
|
invokeAndCastCollection(T returnType,
java.lang.reflect.Method m,
java.lang.Object obj,
java.lang.Object... args)
Same as but with a cast to Collection |
|
static
|
invokeAndCastEnumeration(T returnType,
java.lang.reflect.Method m,
java.lang.Object obj,
java.lang.Object... args)
Same as but with a cast to Enumeration |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionHelper()
Method Detail |
---|
public static java.lang.reflect.Method getMethodOnlyByName(java.lang.Class<?> c, java.lang.String methodName) throws java.lang.NoSuchMethodException
c
- Class to searchmethodName
- Methodname to search
java.lang.NoSuchMethodException
- If the search method isn't shownpublic static <T> T invokeAndCast(T returnType, java.lang.reflect.Method m, java.lang.Object obj, java.lang.Object... args)
public static <T> java.util.Enumeration<T> invokeAndCastEnumeration(T returnType, java.lang.reflect.Method m, java.lang.Object obj, java.lang.Object... args)
but with a cast to Enumeration
invokeAndCast(Object, Method, Object, Object...)
public static <T> java.util.Collection<T> invokeAndCastCollection(T returnType, java.lang.reflect.Method m, java.lang.Object obj, java.lang.Object... args)
but with a cast to Collection
invokeAndCast(Object, Method, Object, Object...)
|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |