Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
BaseConstraint |
|
| 1.0;1 |
1 | package org.kuali.rice.krad.datadictionary.validation.constraint; | |
2 | ||
3 | import java.util.List; | |
4 | ||
5 | import javax.xml.bind.annotation.XmlAccessType; | |
6 | import javax.xml.bind.annotation.XmlAccessorType; | |
7 | import javax.xml.bind.annotation.XmlElement; | |
8 | ||
9 | ||
10 | /** | |
11 | * A class that implements the required accessor for label keys. This provides a convenient base class | |
12 | * from which other constraints can be derived. | |
13 | * | |
14 | * This class is a direct copy of one that was in Kuali Student. | |
15 | * | |
16 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
17 | * @since 1.1 | |
18 | */ | |
19 | @XmlAccessorType(XmlAccessType.FIELD) | |
20 | public class BaseConstraint implements Constraint { | |
21 | @XmlElement | |
22 | protected String labelKey; | |
23 | @XmlElement | |
24 | protected Boolean applyClientSide; | |
25 | ||
26 | List<String> validationMessageParams; | |
27 | ||
28 | 181 | public BaseConstraint(){ |
29 | 181 | applyClientSide = Boolean.valueOf(true); |
30 | 181 | } |
31 | ||
32 | /** | |
33 | * LabelKey should be a single word key. This key is used to find a message to use for this | |
34 | * constraint from available messages. The key is also used for defining/retrieving validation method | |
35 | * names when applicable for ValidCharactersContraints. | |
36 | * | |
37 | * If a comma separated list of keys is used, a message will be generated that is a comma separated list of | |
38 | * the messages retrieved for each key. | |
39 | * | |
40 | * @see ValidCharactersConstraint | |
41 | * | |
42 | * @return | |
43 | */ | |
44 | public String getLabelKey() { | |
45 | 23 | return labelKey; |
46 | } | |
47 | ||
48 | public void setLabelKey(String labelKey) { | |
49 | 0 | this.labelKey = labelKey; |
50 | 0 | } |
51 | ||
52 | /** | |
53 | * If this is true, the constraint should be applied on the client side when the user interacts with | |
54 | * a field - if this constraint can be interpreted for client side use. Default is true. | |
55 | * @return the applyClientSide | |
56 | */ | |
57 | public Boolean getApplyClientSide() { | |
58 | 0 | return this.applyClientSide; |
59 | } | |
60 | ||
61 | /** | |
62 | * @param applyClientSide the applyClientSide to set | |
63 | */ | |
64 | public void setApplyClientSide(Boolean applyClientSide) { | |
65 | 0 | this.applyClientSide = applyClientSide; |
66 | 0 | } |
67 | ||
68 | ||
69 | /** | |
70 | * Parameters to be used in the string retrieved by this constraint's labelKey | |
71 | * @return the validationMessageParams | |
72 | */ | |
73 | public List<String> getValidationMessageParams() { | |
74 | 0 | return this.validationMessageParams; |
75 | } | |
76 | ||
77 | /** | |
78 | * @param validationMessageParams the validationMessageParams to set | |
79 | */ | |
80 | public void setValidationMessageParams(List<String> validationMessageParams) { | |
81 | 0 | this.validationMessageParams = validationMessageParams; |
82 | 0 | } |
83 | ||
84 | ||
85 | } |