info.javelot.functionalj.reflect
Class NullParameter
java.lang.Object
info.javelot.functionalj.reflect.Parameter
info.javelot.functionalj.reflect.NullParameter
- All Implemented Interfaces:
- Serializable
public class NullParameter
- extends Parameter
Used to indicate that a null value should be used for a parameter of
a specific class, in order to remove the ambiguity caused by using simple
null values when a method is overloaded with different parameter
classes.
For example, if a method is overloaded, one which accepts a parameter of type
String, the other of type Integer, and a
null value is to be used as a parameter to the method which accepts a
parameter of type Integer, the following code should be used:
function.addParameter(new NullParameter(Integer.class));
- Author:
- Copyright © 2006
Frederic Daoud
- See Also:
- Serialized Form
|
Constructor Summary |
NullParameter(Class p_parameterClass)
Constructs an object which indicates to use a null value for a
parameter of the specified class. |
|
Method Summary |
String |
toString()
Returns a String representation of the object. |
NullParameter
public NullParameter(Class p_parameterClass)
- Constructs an object which indicates to use a
null value for a
parameter of the specified class.
- Parameters:
p_parameterClass - the class of the parameter for which to use a
null value. The class cannot be null.
- Throws:
FunctionException - thrown if the specified class is
null.
toString
public String toString()
- Returns a
String representation of the object.
- Overrides:
toString in class Object
- Returns:
- a
String representation of the object, of the format
NullParameter(ClassName).