| 1 | |
package org.kuali.rice.core.api.uif; |
| 2 | |
|
| 3 | |
import org.apache.commons.lang.StringUtils; |
| 4 | |
import org.kuali.rice.core.api.CoreConstants; |
| 5 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
| 6 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
| 7 | |
import org.w3c.dom.Element; |
| 8 | |
|
| 9 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 10 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 11 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 12 | |
import javax.xml.bind.annotation.XmlElement; |
| 13 | |
import javax.xml.bind.annotation.XmlElementWrapper; |
| 14 | |
import javax.xml.bind.annotation.XmlElements; |
| 15 | |
import javax.xml.bind.annotation.XmlRootElement; |
| 16 | |
import javax.xml.bind.annotation.XmlType; |
| 17 | |
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.Collection; |
| 20 | |
import java.util.Collections; |
| 21 | |
import java.util.List; |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | 0 | @XmlRootElement(name = RemotableAttributeField.Constants.ROOT_ELEMENT_NAME) |
| 27 | |
@XmlAccessorType(XmlAccessType.NONE) |
| 28 | |
@XmlType(name = RemotableAttributeField.Constants.TYPE_NAME, propOrder = { |
| 29 | |
RemotableAttributeField.Elements.NAME, |
| 30 | |
RemotableAttributeField.Elements.DATA_TYPE, |
| 31 | |
RemotableAttributeField.Elements.SHORT_LABEL, |
| 32 | |
RemotableAttributeField.Elements.LONG_LABEL, |
| 33 | |
RemotableAttributeField.Elements.HELP_SUMMARY, |
| 34 | |
RemotableAttributeField.Elements.HELP_CONSTRAINT, |
| 35 | |
RemotableAttributeField.Elements.HELP_DESCRIPTION, |
| 36 | |
RemotableAttributeField.Elements.FORCE_UPPERCASE, |
| 37 | |
RemotableAttributeField.Elements.MIN_LENGTH, |
| 38 | |
RemotableAttributeField.Elements.MAX_LENGTH, |
| 39 | |
RemotableAttributeField.Elements.MIN_VALUE, |
| 40 | |
RemotableAttributeField.Elements.MAX_VALUE, |
| 41 | |
RemotableAttributeField.Elements.REGEX_CONSTRAINT, |
| 42 | |
RemotableAttributeField.Elements.REGEX_CONSTRAINT_MSG, |
| 43 | |
RemotableAttributeField.Elements.REQUIRED, |
| 44 | |
RemotableAttributeField.Elements.DEFAULT_VALUES, |
| 45 | |
RemotableAttributeField.Elements.ATTRIBUTE_LOOKUP_SETTINGS, |
| 46 | |
RemotableAttributeField.Elements.CONTROL, |
| 47 | |
RemotableAttributeField.Elements.WIDGETS, |
| 48 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS }) |
| 49 | 6 | public final class RemotableAttributeField extends AbstractDataTransferObject implements AttributeField { |
| 50 | |
|
| 51 | |
@XmlElement(name = Elements.NAME, required = true) |
| 52 | |
private final String name; |
| 53 | |
|
| 54 | |
@XmlJavaTypeAdapter(DataType.Adapter.class) |
| 55 | |
@XmlElement(name = Elements.DATA_TYPE, required = false) |
| 56 | |
private final String dataType; |
| 57 | |
|
| 58 | |
@XmlElement(name = Elements.SHORT_LABEL, required = false) |
| 59 | |
private final String shortLabel; |
| 60 | |
|
| 61 | |
@XmlElement(name = Elements.LONG_LABEL, required = false) |
| 62 | |
private final String longLabel; |
| 63 | |
|
| 64 | |
@XmlElement(name = Elements.HELP_SUMMARY, required = false) |
| 65 | |
private final String helpSummary; |
| 66 | |
|
| 67 | |
@XmlElement(name = Elements.HELP_CONSTRAINT, required = false) |
| 68 | |
private final String helpConstraint; |
| 69 | |
|
| 70 | |
@XmlElement(name = Elements.HELP_DESCRIPTION, required = false) |
| 71 | |
private final String helpDescription; |
| 72 | |
|
| 73 | |
@XmlElement(name = Elements.FORCE_UPPERCASE, required = false) |
| 74 | |
private final boolean forceUpperCase; |
| 75 | |
|
| 76 | |
@XmlElement(name = Elements.MIN_LENGTH, required = false) |
| 77 | |
private final Integer minLength; |
| 78 | |
|
| 79 | |
@XmlElement(name = Elements.MAX_LENGTH, required = false) |
| 80 | |
private final Integer maxLength; |
| 81 | |
|
| 82 | |
@XmlElement(name = Elements.MIN_VALUE, required = false) |
| 83 | |
private final Double minValue; |
| 84 | |
|
| 85 | |
@XmlElement(name = Elements.MAX_VALUE, required = false) |
| 86 | |
private final Double maxValue; |
| 87 | |
|
| 88 | |
@XmlElement(name = Elements.REGEX_CONSTRAINT, required = false) |
| 89 | |
private final String regexConstraint; |
| 90 | |
|
| 91 | |
@XmlElement(name = Elements.REGEX_CONSTRAINT_MSG, required = false) |
| 92 | |
private final String regexContraintMsg; |
| 93 | |
|
| 94 | |
@XmlElement(name = Elements.REQUIRED, required = false) |
| 95 | |
private final boolean required; |
| 96 | |
|
| 97 | |
@XmlElementWrapper(name = Elements.DEFAULT_VALUES, required = false) |
| 98 | |
@XmlElement(name = Elements.DEFAULT_VALUE, required = false) |
| 99 | |
private final Collection<String> defaultValues; |
| 100 | |
|
| 101 | |
@XmlElement(name = Elements.ATTRIBUTE_LOOKUP_SETTINGS, required = false) |
| 102 | |
private final RemotableAttributeLookupSettings attributeLookupSettings; |
| 103 | |
|
| 104 | |
@XmlElements(value = { |
| 105 | |
@XmlElement(name = RemotableCheckboxGroup.Constants.ROOT_ELEMENT_NAME, type = RemotableCheckboxGroup.class, required = false), |
| 106 | |
@XmlElement(name = RemotableHiddenInput.Constants.ROOT_ELEMENT_NAME, type = RemotableHiddenInput.class, required = false), |
| 107 | |
@XmlElement(name = RemotablePasswordInput.Constants.ROOT_ELEMENT_NAME, type = RemotablePasswordInput.class, required = false), |
| 108 | |
@XmlElement(name = RemotableRadioButtonGroup.Constants.ROOT_ELEMENT_NAME, type = RemotableRadioButtonGroup.class, required = false), |
| 109 | |
@XmlElement(name = RemotableSelect.Constants.ROOT_ELEMENT_NAME, type = RemotableSelect.class, required = false), |
| 110 | |
@XmlElement(name = RemotableTextarea.Constants.ROOT_ELEMENT_NAME, type = RemotableTextarea.class, required = false), |
| 111 | |
@XmlElement(name = RemotableTextInput.Constants.ROOT_ELEMENT_NAME, type = RemotableTextInput.class, required = false) |
| 112 | |
}) |
| 113 | |
private final RemotableAbstractControl control; |
| 114 | |
|
| 115 | |
@XmlElementWrapper(name = Elements.WIDGETS, required = false) |
| 116 | |
@XmlElements(value = { |
| 117 | |
@XmlElement(name = RemotableDatepicker.Constants.ROOT_ELEMENT_NAME, type = RemotableDatepicker.class, required = false), |
| 118 | |
@XmlElement(name = RemotableQuickFinder.Constants.ROOT_ELEMENT_NAME, type = RemotableQuickFinder.class, required = false), |
| 119 | |
@XmlElement(name = RemotableTextExpand.Constants.ROOT_ELEMENT_NAME, type = RemotableTextExpand.class, required = false) |
| 120 | |
}) |
| 121 | |
private final Collection<? extends RemotableAbstractWidget> widgets; |
| 122 | |
|
| 123 | 10 | @SuppressWarnings("unused") |
| 124 | |
@XmlAnyElement |
| 125 | |
private final Collection<Element> _futureElements = null; |
| 126 | |
|
| 127 | |
|
| 128 | |
|
| 129 | |
|
| 130 | |
@SuppressWarnings("unused") |
| 131 | 4 | private RemotableAttributeField() { |
| 132 | 4 | this.name = null; |
| 133 | 4 | this.dataType = null; |
| 134 | 4 | this.shortLabel = null; |
| 135 | 4 | this.longLabel = null; |
| 136 | 4 | this.helpSummary = null; |
| 137 | 4 | this.helpConstraint = null; |
| 138 | 4 | this.helpDescription = null; |
| 139 | 4 | this.forceUpperCase = false; |
| 140 | 4 | this.minLength = null; |
| 141 | 4 | this.maxLength = null; |
| 142 | 4 | this.minValue = null; |
| 143 | 4 | this.maxValue = null; |
| 144 | 4 | this.regexConstraint = null; |
| 145 | 4 | this.regexContraintMsg = null; |
| 146 | 4 | this.required = false; |
| 147 | 4 | this.defaultValues = null; |
| 148 | 4 | this.attributeLookupSettings = null; |
| 149 | 4 | this.control = null; |
| 150 | 4 | this.widgets = null; |
| 151 | 4 | } |
| 152 | |
|
| 153 | 6 | private RemotableAttributeField(Builder b) { |
| 154 | 6 | this.name = b.name; |
| 155 | 6 | if (b.dataType == null) { |
| 156 | 4 | this.dataType = null; |
| 157 | |
} else { |
| 158 | 2 | this.dataType = b.dataType.name(); |
| 159 | |
} |
| 160 | 6 | this.shortLabel = b.shortLabel; |
| 161 | 6 | this.longLabel = b.longLabel; |
| 162 | 6 | this.helpSummary = b.helpSummary; |
| 163 | 6 | this.helpConstraint = b.helpConstraint; |
| 164 | 6 | this.helpDescription = b.helpDescription; |
| 165 | 6 | this.forceUpperCase = b.forceUpperCase; |
| 166 | 6 | this.minLength = b.minLength; |
| 167 | 6 | this.maxLength = b.maxLength; |
| 168 | 6 | this.minValue = b.minValue; |
| 169 | 6 | this.maxValue = b.maxValue; |
| 170 | 6 | this.regexConstraint = b.regexConstraint; |
| 171 | 6 | this.regexContraintMsg = b.regexContraintMsg; |
| 172 | 6 | this.required = b.required; |
| 173 | 6 | if (b.defaultValues == null) { |
| 174 | 1 | this.defaultValues = Collections.emptyList(); |
| 175 | |
} else { |
| 176 | 5 | List<String> defaultValuesCopy = new ArrayList<String>(b.defaultValues); |
| 177 | 5 | this.defaultValues = Collections.unmodifiableList(defaultValuesCopy); |
| 178 | |
} |
| 179 | 6 | if (b.attributeLookupSettings == null) { |
| 180 | 6 | this.attributeLookupSettings = null; |
| 181 | |
} else { |
| 182 | 0 | this.attributeLookupSettings = b.attributeLookupSettings.build(); |
| 183 | |
} |
| 184 | 6 | if (b.control == null) { |
| 185 | 4 | this.control = null; |
| 186 | |
} else { |
| 187 | 2 | this.control = b.control.build(); |
| 188 | |
} |
| 189 | |
|
| 190 | 6 | final List<RemotableAbstractWidget> temp = new ArrayList<RemotableAbstractWidget>(); |
| 191 | 6 | if (b.widgets != null) { |
| 192 | 5 | for (RemotableAbstractWidget.Builder attr : b.widgets) { |
| 193 | 2 | temp.add(attr.build()); |
| 194 | |
} |
| 195 | |
} |
| 196 | 6 | this.widgets = Collections.unmodifiableList(temp); |
| 197 | 6 | } |
| 198 | |
|
| 199 | |
@Override |
| 200 | |
public String getName() { |
| 201 | 0 | return name; |
| 202 | |
} |
| 203 | |
|
| 204 | |
@Override |
| 205 | |
public DataType getDataType() { |
| 206 | 0 | if (dataType == null) { |
| 207 | 0 | return null; |
| 208 | |
} |
| 209 | 0 | return DataType.valueOf(dataType); |
| 210 | |
} |
| 211 | |
|
| 212 | |
@Override |
| 213 | |
public String getShortLabel() { |
| 214 | 0 | return shortLabel; |
| 215 | |
} |
| 216 | |
|
| 217 | |
@Override |
| 218 | |
public String getLongLabel() { |
| 219 | 0 | return longLabel; |
| 220 | |
} |
| 221 | |
|
| 222 | |
@Override |
| 223 | |
public String getHelpSummary() { |
| 224 | 0 | return helpSummary; |
| 225 | |
} |
| 226 | |
|
| 227 | |
@Override |
| 228 | |
public String getHelpConstraint() { |
| 229 | 0 | return helpConstraint; |
| 230 | |
} |
| 231 | |
|
| 232 | |
@Override |
| 233 | |
public String getHelpDescription() { |
| 234 | 0 | return helpDescription; |
| 235 | |
} |
| 236 | |
|
| 237 | |
@Override |
| 238 | |
public boolean isForceUpperCase() { |
| 239 | 0 | return forceUpperCase; |
| 240 | |
} |
| 241 | |
|
| 242 | |
@Override |
| 243 | |
public Integer getMinLength() { |
| 244 | 0 | return minLength; |
| 245 | |
} |
| 246 | |
|
| 247 | |
@Override |
| 248 | |
public Integer getMaxLength() { |
| 249 | 0 | return maxLength; |
| 250 | |
} |
| 251 | |
|
| 252 | |
@Override |
| 253 | |
public Double getMinValue() { |
| 254 | 0 | return minValue; |
| 255 | |
} |
| 256 | |
|
| 257 | |
@Override |
| 258 | |
public Double getMaxValue() { |
| 259 | 0 | return maxValue; |
| 260 | |
} |
| 261 | |
|
| 262 | |
@Override |
| 263 | |
public String getRegexConstraint() { |
| 264 | 0 | return regexConstraint; |
| 265 | |
} |
| 266 | |
|
| 267 | |
@Override |
| 268 | |
public String getRegexContraintMsg() { |
| 269 | 0 | return regexContraintMsg; |
| 270 | |
} |
| 271 | |
|
| 272 | |
@Override |
| 273 | |
public boolean isRequired() { |
| 274 | 0 | return required; |
| 275 | |
} |
| 276 | |
|
| 277 | |
@Override |
| 278 | |
public Collection<String> getDefaultValues() { |
| 279 | 0 | return defaultValues; |
| 280 | |
} |
| 281 | |
|
| 282 | |
@Override |
| 283 | |
public RemotableAbstractControl getControl() { |
| 284 | 0 | return control; |
| 285 | |
} |
| 286 | |
|
| 287 | |
@Override |
| 288 | |
public Collection<? extends RemotableAbstractWidget> getWidgets() { |
| 289 | 0 | return widgets; |
| 290 | |
} |
| 291 | |
|
| 292 | |
@Override |
| 293 | |
public RemotableAttributeLookupSettings getAttributeLookupSettings() { |
| 294 | 0 | return attributeLookupSettings; |
| 295 | |
} |
| 296 | |
|
| 297 | |
|
| 298 | |
|
| 299 | |
|
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
public static RemotableAttributeField findAttribute(String attributeName, Collection<RemotableAttributeField> fields) { |
| 307 | 0 | if (StringUtils.isBlank(attributeName)) { |
| 308 | 0 | throw new IllegalArgumentException("attributeName is blank"); |
| 309 | |
} |
| 310 | |
|
| 311 | 0 | if (fields == null) { |
| 312 | 0 | throw new IllegalArgumentException("errors is null"); |
| 313 | |
} |
| 314 | |
|
| 315 | 0 | for (RemotableAttributeField field : fields) { |
| 316 | 0 | if (attributeName.equals(field.getName())) { |
| 317 | 0 | return field; |
| 318 | |
} |
| 319 | |
} |
| 320 | 0 | return null; |
| 321 | |
} |
| 322 | |
|
| 323 | 134 | public static final class Builder implements AttributeField, ModelBuilder { |
| 324 | |
private String name; |
| 325 | |
private DataType dataType; |
| 326 | |
private String shortLabel; |
| 327 | |
private String longLabel; |
| 328 | |
|
| 329 | |
private String helpSummary; |
| 330 | |
private String helpConstraint; |
| 331 | |
private String helpDescription; |
| 332 | |
|
| 333 | |
private boolean forceUpperCase; |
| 334 | |
|
| 335 | |
private Integer minLength; |
| 336 | |
private Integer maxLength; |
| 337 | |
|
| 338 | |
private Double minValue; |
| 339 | |
private Double maxValue; |
| 340 | |
private String regexConstraint; |
| 341 | |
private String regexContraintMsg; |
| 342 | |
|
| 343 | |
private boolean required; |
| 344 | |
|
| 345 | 8 | private Collection<String> defaultValues = new ArrayList<String>(); |
| 346 | |
private RemotableAttributeLookupSettings.Builder attributeLookupSettings; |
| 347 | |
private RemotableAbstractControl.Builder control; |
| 348 | |
|
| 349 | 8 | private Collection<RemotableAbstractWidget.Builder> widgets = new ArrayList<RemotableAbstractWidget.Builder>(); |
| 350 | |
|
| 351 | 8 | private Builder(String name) { |
| 352 | 8 | setName(name); |
| 353 | 6 | } |
| 354 | |
|
| 355 | |
public static Builder create(String name) { |
| 356 | 8 | return new Builder(name); |
| 357 | |
} |
| 358 | |
|
| 359 | |
public static Builder create(AttributeField field) { |
| 360 | 0 | if (field == null) { |
| 361 | 0 | throw new IllegalArgumentException("field was null"); |
| 362 | |
} |
| 363 | |
|
| 364 | 0 | Builder b = new Builder(field.getName()); |
| 365 | 0 | b.setDataType(field.getDataType()); |
| 366 | 0 | b.setShortLabel(field.getShortLabel()); |
| 367 | 0 | b.setLongLabel(field.getLongLabel()); |
| 368 | 0 | b.setHelpSummary(field.getHelpSummary()); |
| 369 | 0 | b.setHelpConstraint(field.getHelpConstraint()); |
| 370 | 0 | b.setHelpDescription(field.getHelpDescription()); |
| 371 | 0 | b.setForceUpperCase(field.isForceUpperCase()); |
| 372 | 0 | b.setMinLength(field.getMinLength()); |
| 373 | 0 | b.setMaxLength(field.getMaxLength()); |
| 374 | 0 | b.setMinValue(field.getMinValue()); |
| 375 | 0 | b.setMaxValue(field.getMaxValue()); |
| 376 | 0 | b.setRegexConstraint(field.getRegexConstraint()); |
| 377 | 0 | b.setRegexContraintMsg(field.getRegexContraintMsg()); |
| 378 | 0 | b.setRequired(field.isRequired()); |
| 379 | 0 | b.setDefaultValues(field.getDefaultValues()); |
| 380 | 0 | if (field.getAttributeLookupSettings() != null) { |
| 381 | 0 | b.setAttributeLookupSettings(RemotableAttributeLookupSettings.Builder.create( |
| 382 | |
field.getAttributeLookupSettings())); |
| 383 | |
} |
| 384 | 0 | if (field.getControl() != null) { |
| 385 | 0 | b.setControl(ControlCopy.toBuilder(field.getControl())); |
| 386 | |
} |
| 387 | |
|
| 388 | 0 | final List<RemotableAbstractWidget.Builder> temp = new ArrayList<RemotableAbstractWidget.Builder>(); |
| 389 | 0 | if (field.getWidgets() != null) { |
| 390 | 0 | for (Widget w : field.getWidgets()) { |
| 391 | 0 | temp.add(WidgetCopy.toBuilder(w)); |
| 392 | |
} |
| 393 | |
} |
| 394 | 0 | b.setWidgets(temp); |
| 395 | |
|
| 396 | 0 | return b; |
| 397 | |
} |
| 398 | |
|
| 399 | |
@Override |
| 400 | |
public String getName() { |
| 401 | 0 | return name; |
| 402 | |
} |
| 403 | |
|
| 404 | |
public void setName(String name) { |
| 405 | 8 | if (StringUtils.isBlank(name)) { |
| 406 | 2 | throw new IllegalArgumentException("name is blank"); |
| 407 | |
} |
| 408 | |
|
| 409 | 6 | this.name = name; |
| 410 | 6 | } |
| 411 | |
|
| 412 | |
@Override |
| 413 | |
public DataType getDataType() { |
| 414 | 0 | return dataType; |
| 415 | |
} |
| 416 | |
|
| 417 | |
public void setDataType(DataType dataType) { |
| 418 | 3 | this.dataType = dataType; |
| 419 | 3 | } |
| 420 | |
|
| 421 | |
@Override |
| 422 | |
public String getShortLabel() { |
| 423 | 0 | return shortLabel; |
| 424 | |
} |
| 425 | |
|
| 426 | |
public void setShortLabel(String shortLabel) { |
| 427 | 3 | this.shortLabel = shortLabel; |
| 428 | 3 | } |
| 429 | |
|
| 430 | |
@Override |
| 431 | |
public String getLongLabel() { |
| 432 | 0 | return longLabel; |
| 433 | |
} |
| 434 | |
|
| 435 | |
public void setLongLabel(String longLabel) { |
| 436 | 2 | this.longLabel = longLabel; |
| 437 | 2 | } |
| 438 | |
|
| 439 | |
@Override |
| 440 | |
public String getHelpSummary() { |
| 441 | 0 | return helpSummary; |
| 442 | |
} |
| 443 | |
|
| 444 | |
public void setHelpSummary(String helpSummary) { |
| 445 | 3 | this.helpSummary = helpSummary; |
| 446 | 3 | } |
| 447 | |
|
| 448 | |
@Override |
| 449 | |
public String getHelpConstraint() { |
| 450 | 0 | return helpConstraint; |
| 451 | |
} |
| 452 | |
|
| 453 | |
public void setHelpConstraint(String helpConstraint) { |
| 454 | 3 | this.helpConstraint = helpConstraint; |
| 455 | 3 | } |
| 456 | |
|
| 457 | |
@Override |
| 458 | |
public String getHelpDescription() { |
| 459 | 0 | return helpDescription; |
| 460 | |
} |
| 461 | |
|
| 462 | |
public void setHelpDescription(String helpDescription) { |
| 463 | 3 | this.helpDescription = helpDescription; |
| 464 | 3 | } |
| 465 | |
|
| 466 | |
@Override |
| 467 | |
public boolean isForceUpperCase() { |
| 468 | 0 | return forceUpperCase; |
| 469 | |
} |
| 470 | |
|
| 471 | |
public void setForceUpperCase(boolean forceUpperCase) { |
| 472 | 2 | this.forceUpperCase = forceUpperCase; |
| 473 | 2 | } |
| 474 | |
|
| 475 | |
@Override |
| 476 | |
public Integer getMinLength() { |
| 477 | 0 | return minLength; |
| 478 | |
} |
| 479 | |
|
| 480 | |
public void setMinLength(Integer minLength) { |
| 481 | 3 | if (minLength != null && minLength < 1) { |
| 482 | 0 | throw new IllegalArgumentException("minLength was < 1"); |
| 483 | |
} |
| 484 | |
|
| 485 | 3 | this.minLength = minLength; |
| 486 | 3 | } |
| 487 | |
|
| 488 | |
@Override |
| 489 | |
public Integer getMaxLength() { |
| 490 | 0 | return maxLength; |
| 491 | |
} |
| 492 | |
|
| 493 | |
public void setMaxLength(Integer maxLength) { |
| 494 | 3 | if (maxLength != null && maxLength < 1) { |
| 495 | 0 | throw new IllegalArgumentException("maxLength was < 1"); |
| 496 | |
} |
| 497 | |
|
| 498 | 3 | this.maxLength = maxLength; |
| 499 | 3 | } |
| 500 | |
|
| 501 | |
@Override |
| 502 | |
public Double getMinValue() { |
| 503 | 0 | return minValue; |
| 504 | |
} |
| 505 | |
|
| 506 | |
public void setMinValue(Double minValue) { |
| 507 | 3 | this.minValue = minValue; |
| 508 | 3 | } |
| 509 | |
|
| 510 | |
@Override |
| 511 | |
public Double getMaxValue() { |
| 512 | 0 | return maxValue; |
| 513 | |
} |
| 514 | |
|
| 515 | |
public void setMaxValue(Double maxValue) { |
| 516 | 3 | this.maxValue = maxValue; |
| 517 | 3 | } |
| 518 | |
|
| 519 | |
@Override |
| 520 | |
public String getRegexConstraint() { |
| 521 | 0 | return regexConstraint; |
| 522 | |
} |
| 523 | |
|
| 524 | |
public void setRegexConstraint(String regexConstraint) { |
| 525 | 3 | this.regexConstraint = regexConstraint; |
| 526 | 3 | } |
| 527 | |
|
| 528 | |
@Override |
| 529 | |
public String getRegexContraintMsg() { |
| 530 | 0 | return regexContraintMsg; |
| 531 | |
} |
| 532 | |
|
| 533 | |
public void setRegexContraintMsg(String regexContraintMsg) { |
| 534 | 3 | this.regexContraintMsg = regexContraintMsg; |
| 535 | 3 | } |
| 536 | |
|
| 537 | |
@Override |
| 538 | |
public boolean isRequired() { |
| 539 | 0 | return required; |
| 540 | |
} |
| 541 | |
|
| 542 | |
public void setRequired(boolean required) { |
| 543 | 2 | this.required = required; |
| 544 | 2 | } |
| 545 | |
|
| 546 | |
@Override |
| 547 | |
public Collection<String> getDefaultValues() { |
| 548 | 0 | return defaultValues; |
| 549 | |
} |
| 550 | |
|
| 551 | |
public void setDefaultValues(Collection<String> defaultValues) { |
| 552 | 4 | this.defaultValues = defaultValues; |
| 553 | 4 | } |
| 554 | |
|
| 555 | |
@Override |
| 556 | |
public RemotableAttributeLookupSettings.Builder getAttributeLookupSettings() { |
| 557 | 0 | return attributeLookupSettings; |
| 558 | |
} |
| 559 | |
|
| 560 | |
public void setAttributeLookupSettings(RemotableAttributeLookupSettings.Builder attributeLookupSettings) { |
| 561 | 0 | this.attributeLookupSettings = attributeLookupSettings; |
| 562 | 0 | } |
| 563 | |
|
| 564 | |
@Override |
| 565 | |
public RemotableAbstractControl.Builder getControl() { |
| 566 | 0 | return control; |
| 567 | |
} |
| 568 | |
|
| 569 | |
public void setControl(RemotableAbstractControl.Builder control) { |
| 570 | 3 | this.control = control; |
| 571 | 3 | } |
| 572 | |
|
| 573 | |
@Override |
| 574 | |
public Collection<RemotableAbstractWidget.Builder> getWidgets() { |
| 575 | 0 | return widgets; |
| 576 | |
} |
| 577 | |
|
| 578 | |
public void setWidgets(Collection<RemotableAbstractWidget.Builder> widgets) { |
| 579 | 4 | this.widgets = widgets; |
| 580 | 4 | } |
| 581 | |
|
| 582 | |
@Override |
| 583 | |
public RemotableAttributeField build() { |
| 584 | 6 | return new RemotableAttributeField(this); |
| 585 | |
} |
| 586 | |
} |
| 587 | |
|
| 588 | |
|
| 589 | |
|
| 590 | |
|
| 591 | 0 | static final class Constants { |
| 592 | |
static final String TYPE_NAME = "AttributeFieldType"; |
| 593 | |
final static String ROOT_ELEMENT_NAME = "attributeField"; |
| 594 | |
} |
| 595 | |
|
| 596 | 0 | static final class Elements { |
| 597 | |
static final String NAME = "name"; |
| 598 | |
static final String DATA_TYPE = "dataType"; |
| 599 | |
static final String SHORT_LABEL = "shortLabel"; |
| 600 | |
static final String LONG_LABEL = "longLabel"; |
| 601 | |
static final String HELP_SUMMARY = "helpSummary"; |
| 602 | |
static final String HELP_CONSTRAINT = "helpConstraint"; |
| 603 | |
static final String HELP_DESCRIPTION = "helpDescription"; |
| 604 | |
static final String FORCE_UPPERCASE = "forceUpperCase"; |
| 605 | |
static final String MIN_LENGTH = "minLength"; |
| 606 | |
static final String MAX_LENGTH = "maxLength"; |
| 607 | |
static final String MIN_VALUE = "minValue"; |
| 608 | |
static final String MAX_VALUE = "maxValue"; |
| 609 | |
static final String REGEX_CONSTRAINT = "regexConstraint"; |
| 610 | |
static final String REGEX_CONSTRAINT_MSG = "regexContraintMsg"; |
| 611 | |
static final String REQUIRED = "required"; |
| 612 | |
static final String DEFAULT_VALUES = "defaultValues"; |
| 613 | |
static final String DEFAULT_VALUE = "defaultValue"; |
| 614 | |
static final String ATTRIBUTE_LOOKUP_SETTINGS = "attributeLookupSettings"; |
| 615 | |
static final String CONTROL = "control"; |
| 616 | |
static final String WIDGETS = "widgets"; |
| 617 | |
} |
| 618 | |
} |