info.javelot.functionalj
Class StaticFunction
java.lang.Object
info.javelot.functionalj.Function
info.javelot.functionalj.ReflectionFunction
info.javelot.functionalj.MethodFunction
info.javelot.functionalj.StaticFunction
- All Implemented Interfaces:
- Serializable
- public class StaticFunction
- extends MethodFunction
Represents a function that targets a static method. See MethodFunction
for information on how method names are matched.
- Author:
- Copyright © 2006
Frederic Daoud
- See Also:
- Serialized Form
|
Constructor Summary |
StaticFunction(Class p_class,
String p_name)
Creates a function that targets the static methods of the given class which
match the given name. |
StaticFunction(Class p_class,
String p_name,
Object[] p_parameters)
Creates a function that targets the static methods of the given class which
match the given name, with the supplied parameters. |
| Methods inherited from class info.javelot.functionalj.Function |
addParameter, addParameters, addParameters, addParameters, addParameters, addParameters, getName, getObject, getParameters, getTargetClass, getTargets, isObjectPresent, objectOrParameter, toString |
StaticFunction
public StaticFunction(Class p_class,
String p_name)
- Creates a function that targets the static methods of the given class which
match the given name. See
StaticFunction(Class,String,Object[]) for more details.
- See Also:
StaticFunction(Class,String,Object[])
StaticFunction
public StaticFunction(Class p_class,
String p_name,
Object[] p_parameters)
- Creates a function that targets the static methods of the given class which
match the given name, with the supplied parameters.
- Parameters:
p_class - the class of the target.p_name - the name to match, either exactly or by interpreting the name as
a property and matching on the corresponding getter and setter methods.p_parameters - the parameters to be supplied to the method.
- Throws:
FunctionException - thrown if no methods of the target class match
the given name.
isObjectRequired
public boolean isObjectRequired()
- Returns
false since an object is not required to invoke the
method.
- Specified by:
isObjectRequired in class Function
- Returns:
false.
newInstance
protected Function newInstance(Class p_class,
Object[] p_parameters)
- Creates a new
StaticFunction object using the specified target
class and parameters.
- Specified by:
newInstance in class Function
- Parameters:
p_class - the class of the target.p_parameters - the supplied parameters.
- Returns:
- a new
StaticFunction object of the target class,
containing the supplied parameters.
object
public Function object(Object p_object)
throws FunctionException
- Throws a
FunctionException, since no object is required to invoke a
static method.
- Specified by:
object in class Function
- Throws:
FunctionException - always thrown since invoking this method is not
applicable to instances of the StaticFunction class.