org.mmbase.util.functions
Class ReturnType

java.lang.Object
  extended byorg.mmbase.core.AbstractDescriptor
      extended byorg.mmbase.util.functions.Parameter
          extended byorg.mmbase.util.functions.ReturnType
All Implemented Interfaces:
Cloneable, Descriptor, Serializable

public class ReturnType
extends Parameter
implements Serializable

Description of the return type of certain function. This wraps a Class object but it has some extra members. Can be used as a constructor argument of Function objects or as an argument of Function.setReturnType(org.mmbase.util.functions.ReturnType).

Since:
MMBase-1.7
Version:
$Id: ReturnType.java,v 1.14 2005/07/28 17:07:55 michiel Exp $
Author:
Daniel Ockeloen, Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mmbase.util.functions.Parameter
Parameter.Wrapper
 
Field Summary
static ReturnType BOOLEAN
          The return type of a function that returns a Boolean.
static ReturnType CHARSEQUENCE
           
static ReturnType COLLECTION
          The return type of a function that returns a Set.
static ReturnType DOUBLE
          The return type of a function that returns a Double.
static ReturnType INTEGER
          The return type of a function that returns a Integer.
static ReturnType LIST
          The return type of a function that returns a List.
static ReturnType LONG
          The return type of a function that returns a Long.
static ReturnType MAP
          The return type of a function that returns a Map.
static ReturnType NODE
          The return type of a function that returns a Node.
static ReturnType NODELIST
          The return type of a function that returns a NodeList.
static ReturnType NONE
          The return type of a function is None
static ReturnType SET
          The return type of a function that returns a Set.
static ReturnType STRING
          The return type of a function that returns a String.
static ReturnType UNKNOWN
          The return type of a function is unknown.
static ReturnType VOID
          The return type of a function that does not return a thing.
static Object VOID_VALUE
          Can be return by functions that don't want to return anything.
 
Fields inherited from class org.mmbase.util.functions.Parameter
CLOUD, CORENODE, dataType, EMPTY, FIELD, LANGUAGE, LOCALE, REQUEST, RESPONSE, USER
 
Fields inherited from class org.mmbase.core.AbstractDescriptor
description, guiName, key
 
Constructor Summary
ReturnType(Class type, String description)
           
 
Method Summary
 ReturnType addSubType(String name, ReturnType type)
          If the return type is like a map or struct (key-values pairs), then you might want to describe the types of the values seperately too.
 Map getSubTypes()
           
 boolean isRequired()
          Returns whether the parameter requires a value.
 String toString()
           
 
Methods inherited from class org.mmbase.util.functions.Parameter
autoCast, checkType, equals, getDataType, getDefaultValue, getTypeAsClass, hashCode, setDefaultValue
 
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

VOID

public static final ReturnType VOID
The return type of a function that does not return a thing.


STRING

public static final ReturnType STRING
The return type of a function that returns a String.


CHARSEQUENCE

public static final ReturnType CHARSEQUENCE

INTEGER

public static final ReturnType INTEGER
The return type of a function that returns a Integer.


LONG

public static final ReturnType LONG
The return type of a function that returns a Long.


DOUBLE

public static final ReturnType DOUBLE
The return type of a function that returns a Double.


BOOLEAN

public static final ReturnType BOOLEAN
The return type of a function that returns a Boolean.


LIST

public static final ReturnType LIST
The return type of a function that returns a List.


NODELIST

public static final ReturnType NODELIST
The return type of a function that returns a NodeList.


NODE

public static final ReturnType NODE
The return type of a function that returns a Node.


SET

public static final ReturnType SET
The return type of a function that returns a Set.


COLLECTION

public static final ReturnType COLLECTION
The return type of a function that returns a Set.


MAP

public static final ReturnType MAP
The return type of a function that returns a Map.


UNKNOWN

public static final ReturnType UNKNOWN
The return type of a function is unknown.


NONE

public static final ReturnType NONE
The return type of a function is None


VOID_VALUE

public static final Object VOID_VALUE
Can be return by functions that don't want to return anything. (The function framework requires you to return something).

Constructor Detail

ReturnType

public ReturnType(Class type,
                  String description)
Method Detail

isRequired

public boolean isRequired()
Description copied from class: Parameter
Returns whether the parameter requires a value.

Overrides:
isRequired in class Parameter
Returns:
true if a value is required

addSubType

public ReturnType addSubType(String name,
                             ReturnType type)
If the return type is like a map or struct (key-values pairs), then you might want to describe the types of the values seperately too.


getSubTypes

public Map getSubTypes()
Returns:
Unmodifiable Map containing the 'subtypes' in case the type is Map. An empty Map otherwise.

toString

public String toString()
Overrides:
toString in class Parameter


MMBase build 1.8.1.20060716