1 10 package org.mmbase.util.functions; 11 12 import java.util.*; 13 14 25 public class ReturnType extends Parameter implements java.io.Serializable { 26 27 30 public static final ReturnType VOID = new ReturnType(void.class, "Does not return anything"); 31 32 35 public static final ReturnType STRING = new ReturnType(String .class, "String"); 36 37 public static final ReturnType CHARSEQUENCE = new ReturnType(CharSequence .class, "CharSequence"); 38 39 42 public static final ReturnType INTEGER = new ReturnType(Integer .class, "Integer"); 43 44 47 public static final ReturnType LONG = new ReturnType(Long .class, "Long"); 48 49 52 public static final ReturnType DOUBLE = new ReturnType(Double .class, "Double"); 53 54 57 public static final ReturnType BOOLEAN = new ReturnType(Boolean .class, "Boolean"); 58 59 62 public static final ReturnType LIST = new ReturnType(List.class, "List"); 63 64 65 68 public static final ReturnType NODELIST = new ReturnType(org.mmbase.bridge.NodeList.class, "NodeList"); 69 70 73 public static final ReturnType NODE = new ReturnType(org.mmbase.bridge.Node.class, "Node"); 74 75 78 public static final ReturnType SET = new ReturnType(Set.class, "Set"); 79 82 public static final ReturnType COLLECTION = new ReturnType(Collection.class, "Collection"); 83 84 87 public static final ReturnType MAP = new ReturnType(Map.class, "Map"); 88 89 92 public static final ReturnType UNKNOWN = new ReturnType(Object .class, "unknown"); 93 94 97 public static final ReturnType NONE = new ReturnType(Object .class, "none"); 98 99 103 public static final Object VOID_VALUE = new Object (); 104 105 private Map typeStruct = new HashMap(); 107 public ReturnType(Class type, String description) { 108 super("RETURN_VALUE", type); 109 setDescription(description, null); 110 } 111 112 public boolean isRequired() { 113 return false; 114 } 115 116 120 public ReturnType addSubType(String name, ReturnType type) { 121 return (ReturnType) typeStruct.put(name, type); 122 } 123 124 127 public Map getSubTypes() { 128 return Collections.unmodifiableMap(typeStruct); 129 } 130 131 132 public String toString() { 133 return getDataType().getTypeAsClass().getName(); 134 } 135 136 } 137 | Popular Tags |