#746: ReflectionHelper.java

projectforge-business/src/main/java/org/projectforge/framework/utils/ReflectionHelper.java Lines: 86 · Type: Java utility — constructor-only reflection 86 lines · 35 code · 45 comments · 6 blank

Purpose

Reflection-based constructor invocation — calls constructors with typed arguments at runtime. 86 lines. Used by the Excel import engine (ClassFactory#380) and other places where objects need to be instantiated from class names and parameters determined at runtime (e.g. instantiating ContentProvider classes from import configuration strings).

Provides overloads for 1-arg and 2-arg constructors as convenience methods, plus a general newInstance(Class, Class[], Object[]) for any number of args. All methods wrap NoSuchMethodException, InvocationTargetException, etc. into RuntimeException (unchecked) so callers don't need try-catch — this is the standard ProjectForge pattern: reflection errors are considered internal errors, not recoverable exceptions.