public class MethodUtil
extends java.lang.Object
| Constructor and Description |
|---|
MethodUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
constructorId(java.lang.reflect.Constructor<?> constructor)
Generate an ID
|
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.annotation.Annotation[] annotations,
java.lang.Class<T> clazz)
Get the annotation we are looking for
|
static java.lang.String |
getCaller()
Get the caller of the method
|
static <A extends java.lang.annotation.Annotation> |
getMethodPOPAnnotation(java.lang.reflect.Method m,
java.lang.Class<A> type)
Get the specified annotation if it exist, if it does it will check the
hierarchy to see if it was not changed from previous declarations.
|
static void |
grant(java.lang.String... signatures)
Whitelist for method access This only work with POJO, for POP Object use
|
static boolean |
hasAnnotation(java.lang.annotation.Annotation[] annotations,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Check if an array of annotations contains a specific type of annotation
|
static boolean |
isMethodPOPAnnotated(java.lang.reflect.Method method)
Tell if a given method as a POPSync* or POPAsync* annotation.
|
static int |
methodId(java.lang.reflect.Method method)
Generate an ID or use the one specified
|
public static boolean isMethodPOPAnnotated(java.lang.reflect.Method method)
method - a methodpublic static <A extends java.lang.annotation.Annotation> A getMethodPOPAnnotation(java.lang.reflect.Method m,
java.lang.Class<A> type)
A - The wanted annotationm - The method to checktype - The class ofjava.lang.RuntimeException - when the POP annotation soddenly change from a previous
implementationpublic static int methodId(java.lang.reflect.Method method)
method - the method we want the ID ofpublic static int constructorId(java.lang.reflect.Constructor<?> constructor)
constructor - a constructorpublic static boolean hasAnnotation(java.lang.annotation.Annotation[] annotations,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
annotations - an annotation arrayclazz - the annotation type we want to find in the arraypublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.annotation.Annotation[] annotations,
java.lang.Class<T> clazz)
T - the type of annotationannotations - an array of annotationsclazz - the annotation type we want to find in the arraypublic static java.lang.String getCaller()
public static void grant(java.lang.String... signatures)
signatures - [class].[method] list of whitelisted method