public class ReflectionLoading extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReflectionLoading.ReflectionLoadingException
This class encapsulates all of the exceptions that can be thrown
when loading something by reflection.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
loadByReflection(String className,
Object... arguments)
Create an object of type T by calling the class constructor with the given arguments.
|
public static <T> T loadByReflection(String className, Object... arguments)
String s = ReflectionLoading.loadByReflection("java.lang.String", "foo");
String s = ReflectionLoading.loadByReflection("java.lang.String");
Integer i = ReflectionLoading.loadByReflection("java.lang.String");