|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.core.AbstractDescriptor
org.mmbase.util.functions.Parameter
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.
Parameters,
Serialized Form| Nested Class Summary | |
static class |
Parameter.Wrapper
A Parameter.Wrapper wraps one Parameter around a Parameter[] (then you can put it in a Parameter[]). |
| Field Summary | |
static Parameter |
CLOUD
|
static Parameter |
CORENODE
|
protected DataType |
dataType
The parameter's data type |
static Parameter[] |
EMPTY
An empty Parameter array. |
static Parameter |
FIELD
|
static Parameter |
LANGUAGE
Parameter which might be needed in lots of Parameter definitions. |
static Parameter |
LOCALE
|
static Parameter |
NODE
'system' parameter set for nodefunctions. |
static Parameter |
REQUEST
|
static Parameter |
RESPONSE
|
static Parameter |
USER
|
| Fields inherited from class org.mmbase.core.AbstractDescriptor |
description, guiName, key |
| Constructor Summary | |
Parameter(Parameter p,
boolean required)
Copy-constructor, just to copy it with different requiredness |
|
Parameter(Parameter p,
Object defaultValue)
Copy-constructor, just to copy it with different defaultValue (which implies that it is not required now) |
|
Parameter(String name,
Class type)
Create a Parameter object |
|
Parameter(String name,
Class type,
boolean required)
Create a Parameter object |
|
Parameter(String name,
Class type,
Object defaultValue)
Create a Parameter object |
|
Parameter(String name,
DataType dataType)
Create a Parameter object |
|
Parameter(String name,
DataType dataType,
boolean copy)
Create a Parameter object |
|
| Method Summary | |
protected Object |
autoCast(Object value)
Tries to 'cast' an object for use with this parameter. |
void |
checkType(Object value)
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. |
boolean |
equals(Object o)
Whether parameter equals to other parameter. |
DataType |
getDataType()
Returns the data type of this parameter. |
Object |
getDefaultValue()
Returns the default value of this parameter (derived from the datatype). |
Class |
getTypeAsClass()
Returns the type of values that this parameter accepts. |
int |
hashCode()
|
boolean |
isRequired()
Returns whether the parameter requires a value. |
void |
setDefaultValue(Object defaultValue)
Sets the default value of this parameter. |
String |
toString()
|
| Methods inherited from class org.mmbase.core.AbstractDescriptor |
clone, clone, getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Parameter LANGUAGE
public static final Parameter LOCALE
public static final Parameter USER
public static final Parameter RESPONSE
public static final Parameter REQUEST
public static final Parameter CLOUD
public static final Parameter NODE
public static final Parameter CORENODE
public static final Parameter FIELD
public static final Parameter[] EMPTY
protected DataType dataType
| Constructor Detail |
public Parameter(String name,
DataType dataType)
name - the name of the parameterdataType - the datatype of the parameter to copy
public Parameter(String name,
DataType dataType,
boolean copy)
name - the name of the parameterdataType - the datatype of the parameter to assign or copycopy - if true, teh datatype is copied. if not, it is assigned directly,
that is, changing condfiitons on the parameter changes the passed datatype instance.
public Parameter(String name,
Class type)
name - the name of the parametertype - the class of the parameter's possible value
public Parameter(String name,
Class type,
boolean required)
name - the name of the parametertype - the class of the parameter's possible valuerequired - whether the parameter requires a value
public Parameter(String name,
Class type,
Object defaultValue)
name - the name of the parametertype - the class of the parameter's possible valuedefaultValue - the value to use if the parameter has no value set
public Parameter(Parameter p,
boolean required)
public Parameter(Parameter p,
Object defaultValue)
| Method Detail |
public Object getDefaultValue()
public void setDefaultValue(Object defaultValue)
defaultValue - the default valuepublic DataType getDataType()
public Class getTypeAsClass()
public boolean isRequired()
true if a value is requiredpublic void checkType(Object value)
value - teh value whose type (class) to check
IllegalArgumentException - if the type is not compatibleprotected Object autoCast(Object value)
value - The value to be filled in in this Parameter.public int hashCode()
public boolean equals(Object o)
public String toString()
toString in class AbstractDescriptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||