Package org.eclipse.net4j.util
Class ReflectUtil
java.lang.Object
org.eclipse.net4j.util.ReflectUtil
Various static helper methods for dealing with Java reflection.
- Since:
- 3.14
- Author:
- Eike Stepper
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Annotates fields that are to be skipped inReflectUtil.collectFields()
andReflectUtil.toString()
.static enum
static class
static final class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendStackTrace
(StringBuilder builder, StackTraceElement[] stackTrace) static void
collectFields
(Class<?> c, List<Field> fields) static void
static void
static void
dump
(Object object, String prefix, PrintStream out) static void
dump
(Object object, Predicate<ReflectUtil.Setting> consumer) static String
dumpToArray
(Object object) static Field
getAccessibleField
(Class<?> c, String fieldName) Deprecated.static Field
static Integer
getHashCode
(Object object) static Long
static String
static Method
static Method
getMethodOrNull
(Class<?> c, String methodName, Class<?>... parameterTypes) static String
getPackageName
(Class<? extends Object> c) static String
getPackageName
(String className) static String
getSimpleClassName
(Object object) static String
getSimpleClassName
(String name) static String
getSimpleName
(Class<? extends Object> c) static Object
static <T> T
static Object
instantiate
(Map<Object, Object> properties, String namespace, String classKey, ClassLoader classLoader) static Object
invokeMethod
(Method method, Object target, Object... arguments) static <T> T
invokeMethod
(String methodName, Object target) static boolean
static boolean
isSetterName
(String name) static <T> void
makeAccessible
(AccessibleObject accessibleObject) static void
Prints the stack trace of the current thread toSystem.err
.static void
printStackTrace
(PrintStream out, StackTraceElement[] stackTrace) static void
printStackTrace
(StackTraceElement[] stackTrace) static void
static void
static String
static String
-
Field Details
-
ROOT_CLASS
-
NO_PARAMETERS
-
NO_ARGUMENTS
-
REMEMBER_IDS
public static boolean REMEMBER_IDS- Since:
- 3.3
-
DUMP_STATICS
public static boolean DUMP_STATICS
-
-
Method Details
-
makeAccessible
- Since:
- 3.12
-
getMethod
-
getMethodOrNull
- Since:
- 3.20
-
invokeMethod
-
invokeMethod
- Since:
- 3.14
-
getField
-
getAccessibleField
Deprecated.As of 3.14 usegetField(Class, String)
.- Since:
- 3.8
-
collectFields
-
getValue
-
getValue
- Since:
- 3.14
-
setValue
-
setValue
- Since:
- 3.14
-
dumpThread
- Since:
- 3.8
-
appendStackTrace
- Since:
- 3.11
-
printStackTrace
-
printStackTrace
-
printStackTrace
public static void printStackTrace()Prints the stack trace of the current thread toSystem.err
.- Since:
- 3.4
-
getHashCode
-
getID
-
getPackageName
-
getPackageName
-
getSimpleName
-
getSimpleClassName
-
getSimpleClassName
-
getLabel
-
dump
-
dump
-
dump
-
dump
- Since:
- 3.22
-
dumpToArray
-
instantiate
public static Object instantiate(Map<Object, Object> properties, String namespace, String classKey, ClassLoader classLoader) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException -
isSetter
-
isSetterName
-
toString
-
toString
-
getField(Class, String)
.