1 15 package org.apache.tapestry.spec; 16 17 import java.util.Arrays ; 18 import java.util.Collection ; 19 import java.util.Collections ; 20 21 import org.apache.hivemind.HiveMind; 22 import org.apache.hivemind.impl.BaseLocatable; 23 import org.apache.hivemind.util.Defense; 24 import org.apache.tapestry.TapestryUtils; 25 26 34 35 public class ParameterSpecification extends BaseLocatable implements IParameterSpecification 36 { 37 private boolean _required = false; 38 39 private String _type; 40 41 42 private String _description; 43 44 45 private String _propertyName; 46 47 48 private String _defaultValue; 49 50 51 private String _defaultBindingType; 52 53 54 private boolean _cache = true; 55 56 57 private Collection _aliasNames = Collections.EMPTY_LIST; 58 59 60 private String _parameterName; 61 62 63 private boolean _deprecated = false; 64 65 69 70 public String getType() 71 { 72 return _type; 73 } 74 75 79 80 public boolean isRequired() 81 { 82 return _required; 83 } 84 85 public void setRequired(boolean value) 86 { 87 _required = value; 88 } 89 90 94 95 public void setType(String value) 96 { 97 _type = value; 98 } 99 100 105 106 public String getDescription() 107 { 108 return _description; 109 } 110 111 116 117 public void setDescription(String description) 118 { 119 _description = description; 120 } 121 122 125 126 public void setPropertyName(String propertyName) 127 { 128 _propertyName = propertyName; 129 } 130 131 134 135 public String getPropertyName() 136 { 137 return _propertyName; 138 } 139 140 143 public String getDefaultValue() 144 { 145 return _defaultValue; 146 } 147 148 151 public void setDefaultValue(String defaultValue) 152 { 153 _defaultValue = defaultValue; 154 } 155 156 157 public String getDefaultBindingType() 158 { 159 return _defaultBindingType; 160 } 161 162 163 public void setDefaultBindingType(String defaultBindingType) 164 { 165 _defaultBindingType = defaultBindingType; 166 } 167 168 169 public boolean getCache() 170 { 171 return _cache; 172 } 173 174 175 public void setCache(boolean cache) 176 { 177 _cache = cache; 178 } 179 180 181 public Collection getAliasNames() 182 { 183 return _aliasNames; 184 } 185 186 187 public String getParameterName() 188 { 189 return _parameterName; 190 } 191 192 193 public void setAliases(String nameList) 194 { 195 if (HiveMind.isNonBlank(nameList)) 196 { 197 String [] names = TapestryUtils.split(nameList); 198 199 _aliasNames = Arrays.asList(names); 200 } 201 } 202 203 204 public void setParameterName(String name) 205 { 206 Defense.notNull(name, "name"); 207 208 _parameterName = name; 209 } 210 211 212 public boolean isDeprecated() 213 { 214 return _deprecated; 215 } 216 217 218 public void setDeprecated(boolean deprecated) 219 { 220 _deprecated = deprecated; 221 } 222 223 } | Popular Tags |