|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.util.Reflection
public class Reflection
Utility classes for handling reflection.
| Method Summary | |
|---|---|
static Object |
newInstance(String className)
Construct a new instance of the class of the specified name with the no-argument constructor. |
static Object |
newInstance(String className,
Object[] args)
Construct a new instance of the class of the specified name with the specified arguments. |
static Object |
newInstance(String className,
Object[] args,
Class[] argClasses)
Construct a new instance of the class of the specified name with the specified arguments and argument classes. |
static Object |
newInstance(String className,
Object[] args,
String[] argClassNames)
Construct a new instance of the class of the specified name with the specified arguments and argument class names. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Object newInstance(String className)
className - Name of class of which to construct an instance.
IllegalArgumentException - If there are errors in construction.
public static Object newInstance(String className,
Object[] args)
All exceptions arising from reflection are converted
to illegal argument exceptions as detailed in the method
documentation to newInstance(String,Object[],String[]).
className - Name of class of which to construct an instance.args - Arguments to supply to constructor.
IllegalArgumentException - If there are errors in construction.
public static Object newInstance(String className,
Object[] args,
String[] argClassNames)
This method converts all exceptions thrown by Class.forName(String) in converting the class names to
classes to illegal argument exceptions. All other exceptions
documented to be thrown by reflection construction are
converted by newInstance(String,Object[],Class[]).
className - Name of class of which to construct an instance.args - Arguments to supply to constructor.argClassNames - Classes of argument determining constructor.
IllegalArgumentException - If there are errors in construction.
public static Object newInstance(String className,
Object[] args,
Class[] argClasses)
All exceptions thrown by reflection are converted to illegal
argument exceptions; this includes exceptions thrown by Class.forName(String) in getting the constructor's class, by
Class.getConstructor(Class[]) in getting the
constructor itself, and by Constructor.newInstance(Object[]) in creating the instance.
className - Name of class of which to construct an instance.args - Arguments to supply to constructor.argClasses - Classes of argument determining constructor.
IllegalArgumentException - If there are errors in construction.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||