Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CustomFormDefinition |
|
| 1.0;1 |
1 | 0 | /** |
2 | * 2014, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos | |
3 | * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt | |
4 | */ | |
5 | ||
6 | package pt.digitalis.dif.dem.objects; | |
7 | ||
8 | import java.util.HashMap; | |
9 | import java.util.List; | |
10 | import java.util.Map; | |
11 | ||
12 | import pt.digitalis.dif.dem.annotations.parameter.FormConfigurable; | |
13 | import pt.digitalis.dif.dem.annotations.parameter.Parameter; | |
14 | import pt.digitalis.dif.dem.interfaces.ICustomFormDefinition; | |
15 | import pt.digitalis.dif.utils.ObjectFormatter; | |
16 | import pt.digitalis.utils.common.collections.CaseInsentiveArrayList; | |
17 | ||
18 | /** | |
19 | * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/> | |
20 | * @created 28/01/2014 | |
21 | */ | |
22 | 0 | public class CustomFormDefinition implements ICustomFormDefinition { |
23 | ||
24 | /** | |
25 | * this specific configuration business ID. Is null this configuration is for all instances of the form (or the | |
26 | * default ones - this s business defined on a per usage basis) | |
27 | */ | |
28 | private String businessConfigurationID; | |
29 | ||
30 | /** | |
31 | * List of parameter customizations as defined in the @{@link FormConfigurable} annotation in linkedToForm @ | |
32 | * {@link Parameter} annotated class fields for given form | |
33 | */ | |
34 | 0 | private Map<String, FormFieldCustomization> customizedParameters = new HashMap<String, FormFieldCustomization>(); |
35 | ||
36 | /** | |
37 | * List of excluded parameters as defined in the @{@link FormConfigurable} annotation in linkedToForm @ | |
38 | * {@link Parameter} annotated class fields for given form | |
39 | */ | |
40 | 0 | private List<String> excludedParameters = new CaseInsentiveArrayList(); |
41 | ||
42 | /** the stage's form name */ | |
43 | private String formName; | |
44 | ||
45 | /** the stage ID */ | |
46 | private String stageID; | |
47 | ||
48 | /** | |
49 | * @see pt.digitalis.dif.dem.interfaces.ICustomFormDefinition#getBusinessConfigurationID() | |
50 | */ | |
51 | public String getBusinessConfigurationID() | |
52 | { | |
53 | 0 | return businessConfigurationID; |
54 | } | |
55 | ||
56 | /** | |
57 | * @see pt.digitalis.dif.dem.interfaces.ICustomFormDefinition#getCustomizedParameters() | |
58 | */ | |
59 | public Map<String, FormFieldCustomization> getCustomizedParameters() | |
60 | { | |
61 | 0 | return customizedParameters; |
62 | } | |
63 | ||
64 | /** | |
65 | * @see pt.digitalis.dif.dem.interfaces.ICustomFormDefinition#getExcludedParameters() | |
66 | */ | |
67 | public List<String> getExcludedParameters() | |
68 | { | |
69 | 0 | return excludedParameters; |
70 | } | |
71 | ||
72 | /** | |
73 | * @see pt.digitalis.dif.dem.interfaces.ICustomFormDefinition#getFormName() | |
74 | */ | |
75 | public String getFormName() | |
76 | { | |
77 | 0 | return formName; |
78 | } | |
79 | ||
80 | /** | |
81 | * @see pt.digitalis.dif.dem.interfaces.ICustomFormDefinition#getStageID() | |
82 | */ | |
83 | public String getStageID() | |
84 | { | |
85 | 0 | return stageID; |
86 | } | |
87 | ||
88 | /** | |
89 | * Modifier for the 'businessConfigurationID' attribute. | |
90 | * | |
91 | * @param businessConfigurationID | |
92 | * the new businessConfigurationID value to set | |
93 | */ | |
94 | public void setBusinessConfigurationID(String businessConfigurationID) | |
95 | { | |
96 | 0 | this.businessConfigurationID = businessConfigurationID; |
97 | 0 | } |
98 | ||
99 | /** | |
100 | * Modifier for the 'customizedParameters' attribute. | |
101 | * | |
102 | * @param customizedParameters | |
103 | * the new customizedParameters value to set | |
104 | */ | |
105 | public void setCustomizedParameters(Map<String, FormFieldCustomization> customizedParameters) | |
106 | { | |
107 | 0 | this.customizedParameters = customizedParameters; |
108 | 0 | } |
109 | ||
110 | /** | |
111 | * Modifier for the 'excludedParameters' attribute. | |
112 | * | |
113 | * @param excludedParameters | |
114 | * the new excludedParameters value to set | |
115 | */ | |
116 | public void setExcludedParameters(CaseInsentiveArrayList excludedParameters) | |
117 | { | |
118 | 0 | this.excludedParameters = excludedParameters; |
119 | 0 | } |
120 | ||
121 | /** | |
122 | * Modifier for the 'formName' attribute. | |
123 | * | |
124 | * @param formName | |
125 | * the new formName value to set | |
126 | */ | |
127 | public void setFormName(String formName) | |
128 | { | |
129 | 0 | this.formName = formName; |
130 | 0 | } |
131 | ||
132 | /** | |
133 | * Modifier for the 'stageID' attribute. | |
134 | * | |
135 | * @param stageID | |
136 | * the new stageID value to set | |
137 | */ | |
138 | public void setStageID(String stageID) | |
139 | { | |
140 | 0 | this.stageID = stageID; |
141 | 0 | } |
142 | ||
143 | /** | |
144 | * @see java.lang.Object#toString() | |
145 | */ | |
146 | @Override | |
147 | public String toString() | |
148 | { | |
149 | 0 | ObjectFormatter formatter = new ObjectFormatter(); |
150 | 0 | formatter.addItem("stageID", this.stageID); |
151 | 0 | formatter.addItem("formName", this.formName); |
152 | 0 | formatter.addItem("businessID", this.businessConfigurationID); |
153 | 0 | formatter.addItem("excludedParameters", this.excludedParameters); |
154 | 0 | formatter.addItem("customizedParameters", this.customizedParameters); |
155 | ||
156 | 0 | return formatter.getFormatedObject(); |
157 | } | |
158 | } |