|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.util.functions.Parameter
Entry for Parameters. A (function) argument is specified by a name and type.
Parameters| 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 |
LANGUAGE
Parameter which might be needed in lots of Parameter definitions. |
static Parameter |
LOCALE
|
static Parameter |
REQUEST
|
static Parameter |
RESPONSE
|
static Parameter |
USER
|
| Constructor Summary | |
protected |
Parameter()
|
|
Parameter(Parameter p,
boolean required)
Copy-constructor, just to copy it with different requiredness |
|
Parameter(Parameter p,
java.lang.Object defaultValue)
Copy-constructor, just to copy it with different defaultValue (which implies that it is not required now) |
|
Parameter(java.lang.String name,
java.lang.Class type)
Create a Parameter object |
|
Parameter(java.lang.String name,
java.lang.Class type,
boolean required)
Create a Parameter object |
|
Parameter(java.lang.String name,
java.lang.Class type,
java.lang.Object defaultValue)
Create a Parameter object |
| Method Summary | |
protected java.lang.Object |
autoCast(java.lang.Object value)
Tries to 'cast' an object for use with this parameter. |
void |
checkType(java.lang.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(java.lang.Object o)
Whether parameter equals to other parameter. |
java.lang.Object |
getDefaultValue()
Returns the default value of this parameter. |
java.lang.String |
getDescription()
Returns the description of this parameter. |
java.lang.String |
getName()
Returns the name or 'key' of this parameter. |
java.lang.Class |
getType()
Returns the type of values that this parameter accepts. |
boolean |
isRequired()
Returns whether the parameter requires a value. |
void |
setDefaultValue(java.lang.Object def)
Sets the default value of this parameter. |
void |
setDescription(java.lang.String description)
Sets the description of this parameter. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, 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
| Constructor Detail |
protected Parameter()
public Parameter(java.lang.String name,
java.lang.Class type)
name - the name of the parametertype - the class of the parameter's possible value
public Parameter(java.lang.String name,
java.lang.Class type,
boolean required)
name - the name of the parametertype - the class of the parameter's possible valuerequired - whether the parameter requires a value (default is false)
public Parameter(java.lang.String name,
java.lang.Class type,
java.lang.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 (default is null)
public Parameter(Parameter p,
boolean required)
public Parameter(Parameter p,
java.lang.Object defaultValue)
| Method Detail |
public java.lang.String getName()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - the description as a Stringpublic java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object def)
def - the default valuepublic java.lang.Class getType()
public boolean isRequired()
true if a value is requiredpublic void checkType(java.lang.Object value)
value - teh value whose type (class) to check
java.lang.IllegalArgumentException - if the type is not compatibleprotected java.lang.Object autoCast(java.lang.Object value)
value - The value to be filled in in this Parameter.public boolean equals(java.lang.Object o)
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||