|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.validation.core.Reflector
public class Reflector
Because the IBM Reflexive GUI Builder appplication is based on the Java Reflection API, we use this class to perform most of the introspection of classes required by the main RGB engine to build and render GUIs. Methods of the Reflector are used to obtain appropriate constructors, methods, and fields of a given class or object.
Nested Class Summary | |
---|---|
class |
Reflector.Result
used primarily by the Reflector class to return the results of introspection |
Constructor Summary | |
---|---|
Reflector()
create a new Reflector for introspecting classes in order to find methods and constructors |
Method Summary | |
---|---|
Reflector.Result |
createReflectorResult(Object member,
Object[] params)
convenience method for creating a Reflector.Result object for use outside Reflector class |
Reflector.Result |
findConstructor(Class objClass,
Parameter ctorArg)
find the constructor of the given class that best fits the given parameters. |
Reflector.Result |
findConstructor(Class objClass,
Parameter[] ctorArgs)
|
Reflector.Result |
findMethod(Object methOwner,
String name,
Parameter arg)
find a method corresponding to the given name and parameters. |
Reflector.Result |
findMethod(Object methOwner,
String name,
Parameter[] args)
|
List |
findMethods(Class cls,
String name)
find a list of methods with the given name that can be invoked on an object of the given class. |
List |
findMethods(Object methodOwner,
String name)
find a list of methods with the given name that can be invoked on the given object |
Object |
getFieldValue(String name,
Class cls)
retreave a static field value with the given name from the given class |
Object |
getFieldValue(String name,
Object object)
retreave a field value with the given name from the given object |
boolean |
setFieldValue(String name,
Object object,
Parameter val)
set the value of the field with the given name on the given object to the value specified |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Reflector()
Method Detail |
---|
public Reflector.Result createReflectorResult(Object member, Object[] params)
member
- -- class memberparams
- -- parameters for invokation of member
public Reflector.Result findConstructor(Class objClass, Parameter ctorArg)
objClass
- -- class of object to be instantiatedctorArg
- -- either single argument for constructor or code block which, upon
evaluation, can be resolved to appropriate arguments
null
if no constructor could be foundpublic Reflector.Result findConstructor(Class objClass, Parameter[] ctorArgs)
objClass
- -- class of object to be instantiatedctorArgs
- -- either single argument for constructor or code block which, upon
evaluation, can be resolved to appropriate arguments
null
if no constructor could be foundfindConstructor(Class, Parameter)
public Reflector.Result findMethod(Object methOwner, String name, Parameter arg)
methOwner
- -- object upon which method is to be invokedname
- -- method namearg
- -- single argument to method or code which, upon evaluation,
can be resolved to appropriate arguments for a method
null
if no method could be foundpublic Reflector.Result findMethod(Object methOwner, String name, Parameter[] args)
methOwner
- -- object upon which method is to be invokedname
- -- method nameargs
- -- single argument to method or code which, upon evaluation,
can be resolved to appropriate arguments for a method
null
if no method could be foundfindMethod(Object, String, Parameter)
public List findMethods(Object methodOwner, String name)
methodOwner
- -- object upon which methods returned could be invokedname
- -- method name
public List findMethods(Class cls, String name)
cls
- -- class of object upon which methods returned could be invokedname
- -- method name
public Object getFieldValue(String name, Class cls)
name
- -- name of field to be queriedcls
- -- class of which field is member
null
if field does not existpublic Object getFieldValue(String name, Object object)
name
- -- name of field to be queriedobject
- -- object of which field is member
null
if field does not existpublic boolean setFieldValue(String name, Object object, Parameter val)
name
- -- name of fieldobject
- -- object whose field is being setval
- -- value of field
true
if setting of field was successful, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |