|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfo.javelot.functionalj.reflect.impl.DynReflectImpl
public class DynReflectImpl
A base for implementating "dynamic" reflection that abstracts how to find methods and constructors, and how to produce functions that invoke them.
| Constructor Summary | |
|---|---|
DynReflectImpl()
Default constructor, which leaves the helper mechanisms unspecified. |
|
DynReflectImpl(ReflectFinder p_finder,
ReflectFactory p_factory,
ReflectParameters p_rp)
Constructor that accepts the mechanisms used for reflection. |
|
| Method Summary | |
|---|---|
FunctionN |
constructor(Class p_class)
Produces a function that creates an instance of the specified class, using a constructor. |
FunctionN |
constructor(String p_class)
Version of DynReflect.constructor(Class) that accepts a String to specify the
class by name. |
FunctionN |
instanceFunction(Class p_class,
String p_name)
Produces a function that invokes the instance method of specified class which has the specified name, using the parameters passed to the function. |
FunctionN |
instanceFunction(Object p_object,
String p_name)
Produces a function that invokes the instance method on the provided object which has the specified name. |
FunctionN |
instanceFunction(String p_class,
String p_name)
Version of DynReflect.instanceFunction(Class,String) that accepts a String to
specify the class by name. |
void |
setReflectFactory(ReflectFactory p_factory)
Sets the mechanism to use for producing a method or constructor invoker. |
void |
setReflectFinder(ReflectFinder p_finder)
Sets the mechanism to use for finding methods and constructors. |
void |
setReflectParameters(ReflectParameters p_rp)
Sets the mechanism to use for finding elements that are compatible with parameters. |
FunctionN |
staticFunction(Class p_class,
String p_name)
Produces a function that invokes the static method of specified class which has the specified name, using the parameters passed to the function. |
FunctionN |
staticFunction(String p_class,
String p_name)
Version of DynReflect.staticFunction(Class,String) that accepts a String to
specify the class by name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DynReflectImpl()
The mechanisms to use for finding methods and constructors
(ReflectFinder) and for
producing a method or constructor invoker (ReflectFactory) are left unspecified
when this default constructor is used. Therefore, they must be specified using
the appropriate setters: setReflectFinder(info.javelot.functionalj.reflect.helper.ReflectFinder) and setReflectFactory(info.javelot.functionalj.reflect.helper.ReflectFactory).
public DynReflectImpl(ReflectFinder p_finder,
ReflectFactory p_factory,
ReflectParameters p_rp)
p_finder - the mechanism used for finding methods and constructors.p_factory - the mechanism used for producing a method or constructor
invoker.p_rp - the mechanism used for finding elements that are compatible with
parameters.| Method Detail |
|---|
public void setReflectFinder(ReflectFinder p_finder)
public void setReflectFactory(ReflectFactory p_factory)
public void setReflectParameters(ReflectParameters p_rp)
public FunctionN constructor(Class p_class)
throws FunctionException
DynReflect
constructor in interface DynReflectp_class - an instance of this class will be created by the function.
The parameters to the constructor will be the same as the parameters
provided to the function.
FunctionException - thrown if a matching constructor was not found.
public FunctionN constructor(String p_class)
throws FunctionException
DynReflectDynReflect.constructor(Class) that accepts a String to specify the
class by name.
constructor in interface DynReflectFunctionException
public FunctionN instanceFunction(Class p_class,
String p_name)
throws FunctionException
DynReflect
instanceFunction in interface DynReflectp_class - the class which contains the instance method to be invoked by
the produced function.p_name - the name of the method.
FunctionException - thrown if a matching instance method was not
found.
public FunctionN instanceFunction(String p_class,
String p_name)
throws FunctionException
DynReflectDynReflect.instanceFunction(Class,String) that accepts a String to
specify the class by name.
instanceFunction in interface DynReflectFunctionException
public FunctionN instanceFunction(Object p_object,
String p_name)
throws FunctionException
DynReflect
instanceFunction in interface DynReflectp_object - the object on which the instance method will be invoked by the
produced function.p_name - the name of the method.
FunctionException - thrown if a matching instance method was not
found.
public FunctionN staticFunction(Class p_class,
String p_name)
throws FunctionException
DynReflect
staticFunction in interface DynReflectp_class - the class which contains the static method to be invoked.
The parameters to the method will be the same as the parameters provided to
the function.p_name - the name of the method.
FunctionException - thrown if a matching static method was not found.
public FunctionN staticFunction(String p_class,
String p_name)
throws FunctionException
DynReflectDynReflect.staticFunction(Class,String) that accepts a String to
specify the class by name.
staticFunction in interface DynReflectFunctionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||