| java.lang.Object org.mmbase.core.AbstractDescriptor org.mmbase.util.functions.Parameter
Parameter | public class Parameter extends AbstractDescriptor implements java.io.Serializable(Code) | | Each (function) argument is specified by a Parameter object.
A Parameter contains a name and type (it does not contain a value). An array of this is returned by
Function.getParameterDefinition , and this same array is used to create new empty
Parameters object (by
Function.createParameters ), which can contain actual values for each Parameter.
author: Daniel Ockeloen (MMFunctionParam) author: Michiel Meeuwissen since: MMBase-1.7 version: $Id: Parameter.java,v 1.46 2007/11/25 18:25:49 nklasens Exp $ See Also: Parameters |
Inner Class :public static class Wrapper extends Parameter | |
Constructor Summary | |
public | Parameter(String name, DataType<C> dataType) | public | Parameter(String name, DataType<C> dataType, boolean copy) Create a Parameter object
Parameters: name - the name of the parameter Parameters: dataType - the datatype of the parameter to assign or copy Parameters: copy - if true , teh datatype is copied. | public | Parameter(String name, Class<C> type) | public | Parameter(String name, Class<C> type, boolean required) | public | Parameter(String name, Class<C> type, C defaultValue) | public | Parameter(String name, C defaultValue) | public | Parameter(Map.Entry<String, C> entry) | public | Parameter(Parameter<C> p, boolean required) | public | Parameter(Parameter<C> p, C defaultValue) |
LANGUAGE | final public static Parameter<String> LANGUAGE(Code) | | Parameter which might be needed in lots of Parameter definitions. These parameters are
'standard' parameters, which can be filled in by the system. E.g. the mmbase taglib uses
these constants, and if it has a cloud ('mm:cloud is used'), then cloud-parameters are filled
automaticly.
|
dataType | protected DataType<C> dataType(Code) | | The parameter's data type
since: MMBase-1.8 |
Parameter | public Parameter(String name, DataType<C> dataType)(Code) | | Create a Parameter object
Parameters: name - the name of the parameter Parameters: dataType - the datatype of the parameter to copy since: MMBase-1.8 |
Parameter | public Parameter(String name, DataType<C> dataType, boolean copy)(Code) | | Create a Parameter object
Parameters: name - the name of the parameter Parameters: dataType - the datatype of the parameter to assign or copy Parameters: copy - if true , teh datatype is copied. if not, it is assigned directly,that is, changing condfiitons on the parameter changes the passed datatype instance. since: MMBase-1.8 |
Parameter | public Parameter(String name, Class<C> type)(Code) | | Create a Parameter object
Parameters: name - the name of the parameter Parameters: type - the class of the parameter's possible value |
Parameter | public Parameter(String name, Class<C> type, boolean required)(Code) | | Create a Parameter object
Parameters: name - the name of the parameter Parameters: type - the class of the parameter's possible value Parameters: required - whether the parameter requires a value |
Parameter | public Parameter(String name, Class<C> type, C defaultValue)(Code) | | Create a Parameter object
Parameters: name - the name of the parameter Parameters: type - the class of the parameter's possible value Parameters: defaultValue - the value to use if the parameter has no value set |
Parameter | public Parameter(String name, C defaultValue)(Code) | | |
Parameter | public Parameter(Map.Entry<String, C> entry)(Code) | | Create Parameter definition by example value
since: MMBase-1.9 |
Parameter | public Parameter(Parameter<C> p, boolean required)(Code) | | Copy-constructor, just to copy it with different requiredness
|
Parameter | public Parameter(Parameter<C> p, C defaultValue)(Code) | | Copy-constructor, just to copy it with different defaultValue (which implies that it is not required now)
|
autoCast | protected C autoCast(Object value)(Code) | | Tries to 'cast' an object for use with this parameter. E.g. if value is a String, but this
parameter is of type Integer, then the string can be parsed to Integer.
Parameters: value - The value to be filled in in this Parameter. |
checkType | public void checkType(Object value)(Code) | | Checks if the passed object is of the correct class (compatible with the type of this Parameter),
and throws an IllegalArgumentException if it doesn't.
Parameters: value - teh value whose type (class) to check throws: IllegalArgumentException - if the type is not compatible |
equals | public boolean equals(Object o)(Code) | | Whether parameter equals to other parameter. Only key and type are consided. DefaultValue and
required propererties are only 'utilities'.
true if o is Parameter of which key and type equal to this' key and type. |
getClassForName | public static Class> getClassForName(String type)(Code) | | since: MMBase-1.9 |
getDataType | public DataType<C> getDataType()(Code) | | Returns the data type of this parameter.
the datatype since: MMBase-1.8 |
getDefaultValue | public C getDefaultValue()(Code) | | Returns the default value of this parameter (derived from the datatype).
the default value |
getTypeAsClass | public Class<C> getTypeAsClass()(Code) | | Returns the type of values that this parameter accepts.
the type as a Class |
hashCode | public int hashCode()(Code) | | |
isRequired | public boolean isRequired()(Code) | | Returns whether the parameter requires a value.
true if a value is required |
setDefaultValue | public void setDefaultValue(C defaultValue)(Code) | | Sets the default value of this parameter.
Parameters: defaultValue - the default value |
|
|