|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.xbus.base.core.reflection.ReflectionSupport
public class ReflectionSupport
ReflectionSupport
provides methods to create objects and call
methods with the reflection API more easy.
Constructor Summary | |
---|---|
ReflectionSupport()
|
Method Summary | |
---|---|
static java.lang.Object |
callMethod(java.lang.String methodname,
java.lang.Object inObject,
java.lang.Class[] parameterTypes,
java.lang.Object[] arguments)
Calls a method with the help of the reflection API. |
static java.lang.Class |
classForName(java.lang.String className)
Returns the Class object associated with the class or
interface with the given string name. |
static java.lang.Object |
createObject(java.lang.String classname)
Create an object of the class with the given name. |
static java.lang.Object |
createObject(java.lang.String classname,
java.lang.Class[] conArgsClass,
java.lang.Object[] conArgs)
Creates an object of the class with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionSupport()
Method Detail |
---|
public static java.lang.Object createObject(java.lang.String classname) throws XException
classname
- fully qualified name of the class
XException
- if the object cannot be createdpublic static java.lang.Object createObject(java.lang.String classname, java.lang.Class[] conArgsClass, java.lang.Object[] conArgs) throws XException
classname
- fully qualified name of the classconArgsClass
- the parameter types for the constructorconArgs
- array of objects to be passed as arguments to the
constructor call
XException
- if the object cannot be createdpublic static java.lang.Class classForName(java.lang.String className) throws XException
Class
object associated with the class or
interface with the given string name.
className
- the fully qualified name of the desired class
Class
object for the class with the specified
name
XException
- if the class cannot be foundpublic static java.lang.Object callMethod(java.lang.String methodname, java.lang.Object inObject, java.lang.Class[] parameterTypes, java.lang.Object[] arguments) throws XException
methodname
- the name of the method to be calledinObject
- the object for which the method shall be calledparameterTypes
- an array containing the classes of the parametersarguments
- an array with the parameters
XException
- if the method cannot be called
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |