|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
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 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
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 boolean _cache = true; |
|
52 |
| |
|
53 |
| |
|
54 |
| private Collection _aliasNames = Collections.EMPTY_LIST; |
|
55 |
| |
|
56 |
| |
|
57 |
| private String _parameterName; |
|
58 |
| |
|
59 |
| |
|
60 |
| private boolean _deprecated = false; |
|
61 |
| |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| |
|
66 |
| |
|
67 |
3465
| public String getType()
|
|
68 |
| { |
|
69 |
3465
| return _type;
|
|
70 |
| } |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
| |
|
76 |
| |
|
77 |
11694
| public boolean isRequired()
|
|
78 |
| { |
|
79 |
11694
| return _required;
|
|
80 |
| } |
|
81 |
| |
|
82 |
3498
| public void setRequired(boolean value)
|
|
83 |
| { |
|
84 |
3498
| _required = value;
|
|
85 |
| } |
|
86 |
| |
|
87 |
| |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
126
| public void setType(String value)
|
|
93 |
| { |
|
94 |
126
| _type = value;
|
|
95 |
| } |
|
96 |
| |
|
97 |
| |
|
98 |
| |
|
99 |
| |
|
100 |
| |
|
101 |
| |
|
102 |
| |
|
103 |
3
| public String getDescription()
|
|
104 |
| { |
|
105 |
3
| return _description;
|
|
106 |
| } |
|
107 |
| |
|
108 |
| |
|
109 |
| |
|
110 |
| |
|
111 |
| |
|
112 |
| |
|
113 |
| |
|
114 |
2556
| public void setDescription(String description)
|
|
115 |
| { |
|
116 |
2556
| _description = description;
|
|
117 |
| } |
|
118 |
| |
|
119 |
| |
|
120 |
| |
|
121 |
| |
|
122 |
| |
|
123 |
3501
| public void setPropertyName(String propertyName)
|
|
124 |
| { |
|
125 |
3501
| _propertyName = propertyName;
|
|
126 |
| } |
|
127 |
| |
|
128 |
| |
|
129 |
| |
|
130 |
| |
|
131 |
| |
|
132 |
6984
| public String getPropertyName()
|
|
133 |
| { |
|
134 |
6984
| return _propertyName;
|
|
135 |
| } |
|
136 |
| |
|
137 |
| |
|
138 |
| |
|
139 |
| |
|
140 |
9963
| public String getDefaultValue()
|
|
141 |
| { |
|
142 |
9963
| return _defaultValue;
|
|
143 |
| } |
|
144 |
| |
|
145 |
| |
|
146 |
| |
|
147 |
| |
|
148 |
3489
| public void setDefaultValue(String defaultValue)
|
|
149 |
| { |
|
150 |
3489
| _defaultValue = defaultValue;
|
|
151 |
| } |
|
152 |
| |
|
153 |
| |
|
154 |
3471
| public boolean getCache()
|
|
155 |
| { |
|
156 |
3471
| return _cache;
|
|
157 |
| } |
|
158 |
| |
|
159 |
| |
|
160 |
3489
| public void setCache(boolean cache)
|
|
161 |
| { |
|
162 |
3489
| _cache = cache;
|
|
163 |
| } |
|
164 |
| |
|
165 |
| |
|
166 |
3522
| public Collection getAliasNames()
|
|
167 |
| { |
|
168 |
3522
| return _aliasNames;
|
|
169 |
| } |
|
170 |
| |
|
171 |
| |
|
172 |
23163
| public String getParameterName()
|
|
173 |
| { |
|
174 |
23163
| return _parameterName;
|
|
175 |
| } |
|
176 |
| |
|
177 |
| |
|
178 |
3504
| public void setAliases(String nameList)
|
|
179 |
| { |
|
180 |
3504
| if (HiveMind.isNonBlank(nameList))
|
|
181 |
| { |
|
182 |
18
| String[] names = TapestryUtils.split(nameList);
|
|
183 |
| |
|
184 |
18
| _aliasNames = Arrays.asList(names);
|
|
185 |
| } |
|
186 |
| } |
|
187 |
| |
|
188 |
| |
|
189 |
3531
| public void setParameterName(String name)
|
|
190 |
| { |
|
191 |
3531
| Defense.notNull(name, "name");
|
|
192 |
| |
|
193 |
3531
| _parameterName = name;
|
|
194 |
| } |
|
195 |
| |
|
196 |
| |
|
197 |
1254
| public boolean isDeprecated()
|
|
198 |
| { |
|
199 |
1254
| return _deprecated;
|
|
200 |
| } |
|
201 |
| |
|
202 |
| |
|
203 |
3492
| public void setDeprecated(boolean deprecated)
|
|
204 |
| { |
|
205 |
3492
| _deprecated = deprecated;
|
|
206 |
| } |
|
207 |
| |
|
208 |
| } |