public final class ReflectionUtils extends Object
| Constructor and Description |
|---|
ReflectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getC10NKey(String keyPrefix,
Method method)
Work out method's bundle key.
|
static String |
getDefaultKey(Method method)
Works out the non-
C10NKey bundle key for method, based on its
class FQDN and method name (plus argument types),
e.g. |
static void |
getDefaultKey(Method method,
StringBuilder sb) |
static String |
getFQNString(Class<?> clazz) |
static void |
getFQNString(Class<?> clazz,
StringBuilder sb) |
static String |
getKeyAnnotationBasedKey(Method method) |
static String |
getKeyAnnotationValue(Method method)
Get the value provided with the
C10NKey annotation. |
public static String getC10NKey(String keyPrefix, Method method)
Work out method's bundle key.
Bundle key is generated as follows:
C10NKey annotations, key is the Class FQDN '.' Method Name.
If method has arguments, method name is post-fixed with argument types delimited
with '_', e.g. myMethod_String_intC10NKey
annotation C then
C10NKey annotation, but a method contains annotation
M, then key is just M.The lookup of c10n key in parent interfaces is done breadth-first, starting from the declaring class. That is, if the declaring class does not have c10n key, all interfaces it extends are checked in declaration order first. If no key is found, this check is repeated for each of the super interfaces in the same order.
keyPrefix - global key prefixmethod - method to extract the key frompublic static String getKeyAnnotationValue(Method method)
Get the value provided with the C10NKey annotation. If annotation
is not declared returns null
method - method for which to retrieve the value C10NKey annotationnull if not present.public static String getDefaultKey(Method method)
Works out the non-C10NKey bundle key for method, based on its
class FQDN and method name (plus argument types),
e.g. com.myCompany.MyClass.myMethod_String_boolean
method - the method for which to work out the key(not null)public static void getDefaultKey(Method method, StringBuilder sb)
public static void getFQNString(Class<?> clazz, StringBuilder sb)
Copyright © 2013. All Rights Reserved.