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
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceAnnotates fields that are to be skipped inReflectUtil.collectFields()andReflectUtil.toString().static enumstatic classstatic final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendStackTrace(StringBuilder builder, StackTraceElement[] stackTrace) static voidcollectFields(Class<?> c, List<Field> fields) static voidstatic voidstatic voiddump(Object object, String prefix, PrintStream out) static voiddump(Object object, Predicate<ReflectUtil.Setting> consumer) static StringdumpToArray(Object object) static FieldgetAccessibleField(Class<?> c, String fieldName) Deprecated.static Fieldstatic IntegergetHashCode(Object object) static Longstatic Stringstatic Methodstatic MethodgetMethodOrNull(Class<?> c, String methodName, Class<?>... parameterTypes) static StringgetPackageName(Class<? extends Object> c) static StringgetPackageName(String className) static StringgetSimpleClassName(Object object) static StringgetSimpleClassName(String name) static StringgetSimpleName(Class<? extends Object> c) static Objectstatic <T> Tstatic Objectinstantiate(Map<Object, Object> properties, String namespace, String classKey, ClassLoader classLoader) static ObjectinvokeMethod(Method method, Object target, Object... arguments) static <T> TinvokeMethod(String methodName, Object target) static booleanstatic booleanisSetterName(String name) static <T> voidmakeAccessible(AccessibleObject accessibleObject) static voidPrints the stack trace of the current thread toSystem.err.static voidprintStackTrace(PrintStream out, StackTraceElement[] stackTrace) static voidprintStackTrace(StackTraceElement[] stackTrace) static voidstatic voidstatic Stringstatic 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).