70 |
70 |
* @param key
|
71 |
71 |
* @return
|
72 |
72 |
*/
|
73 |
|
public static boolean getBoolean(String nodeQualifier, ITXMResult result, String key) {
|
|
73 |
public static boolean getBoolean(String nodeQualifier, ITXMResult result, String key, boolean defaultValue) {
|
74 |
74 |
|
75 |
|
boolean defaultValue = true;
|
76 |
|
boolean value = defaultValue;
|
77 |
|
|
78 |
75 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
79 |
76 |
|
80 |
77 |
defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getBoolean(key, defaultValue);
|
81 |
|
value = scope.getNode(nodeQualifier).getBoolean(key, defaultValue);
|
82 |
|
|
83 |
|
return value;
|
|
78 |
return scope.getNode(nodeQualifier).getBoolean(key, defaultValue);
|
84 |
79 |
}
|
85 |
80 |
|
|
81 |
public static boolean getBoolean(String nodeQualifier, ITXMResult result, String key) {
|
|
82 |
return getBoolean(nodeQualifier, result, key, false);
|
|
83 |
}
|
|
84 |
|
86 |
85 |
/**
|
87 |
86 |
*
|
88 |
87 |
* @param nodeQualifier
|
89 |
88 |
* @param key
|
90 |
89 |
* @return
|
91 |
90 |
*/
|
|
91 |
public static boolean getBoolean(String nodeQualifier, String key, boolean defaultValue) {
|
|
92 |
return getBoolean(nodeQualifier, null, key, defaultValue);
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
*
|
|
97 |
* @param nodeQualifier
|
|
98 |
* @param key
|
|
99 |
* @return
|
|
100 |
*/
|
92 |
101 |
public static boolean getBoolean(String nodeQualifier, String key) {
|
93 |
|
return getBoolean(nodeQualifier, null, key);
|
|
102 |
return getBoolean(nodeQualifier, null, key, false);
|
94 |
103 |
}
|
95 |
104 |
|
96 |
105 |
/**
|
... | ... | |
126 |
135 |
* @return
|
127 |
136 |
*/
|
128 |
137 |
public static String getString(String nodeQualifier, ITXMResult result, String key) {
|
129 |
|
return getString(nodeQualifier, result, key, "");
|
|
138 |
String defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).get(key, "");
|
|
139 |
return getString(nodeQualifier, result, key, defaultValue);
|
130 |
140 |
}
|
131 |
141 |
|
132 |
142 |
public static String getString(String nodeQualifier, String key, String defaultValue) {
|
... | ... | |
135 |
145 |
|
136 |
146 |
public static String getString(String nodeQualifier, ITXMResult result, String key, String defaultValue) {
|
137 |
147 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
138 |
|
|
139 |
|
defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).get(key, defaultValue);
|
140 |
148 |
return scope.getNode(nodeQualifier).get(key, defaultValue);
|
141 |
149 |
}
|
142 |
150 |
|
... | ... | |
147 |
155 |
* @return
|
148 |
156 |
*/
|
149 |
157 |
public static String getString(String nodeQualifier, String key) {
|
150 |
|
return getString(nodeQualifier, null, key, "");
|
|
158 |
String defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).get(key, "");
|
|
159 |
return getString(nodeQualifier, null, key, defaultValue);
|
151 |
160 |
}
|
152 |
161 |
|
153 |
162 |
|
... | ... | |
180 |
189 |
* @param nodeQualifier
|
181 |
190 |
* @param result
|
182 |
191 |
* @param key
|
|
192 |
* @param defaultValue
|
183 |
193 |
* @return
|
184 |
194 |
*/
|
185 |
|
public static int getInt(String nodeQualifier, ITXMResult result, String key) {
|
|
195 |
public static int getInt(String nodeQualifier, ITXMResult result, String key, int defaultValue) {
|
186 |
196 |
|
187 |
|
int defaultValue = -1;
|
188 |
|
int value = defaultValue;
|
189 |
|
|
190 |
197 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
|
198 |
return scope.getNode(nodeQualifier).getInt(key, defaultValue);
|
191 |
199 |
|
192 |
|
defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getInt(key, defaultValue);
|
193 |
|
value = scope.getNode(nodeQualifier).getInt(key, defaultValue);
|
194 |
|
|
195 |
|
return value;
|
196 |
200 |
}
|
197 |
|
|
198 |
201 |
|
199 |
202 |
/**
|
|
203 |
* Looks for the value of the specified <code>key</code> in preference nodes.
|
|
204 |
* Returns the value of the local result node if exists.
|
|
205 |
* Otherwise try to get it from the specified node qualifier if exists.
|
|
206 |
* Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
|
|
207 |
* Returns -1 if no value has been found for the specified key.
|
|
208 |
* @param nodeQualifier
|
|
209 |
* @param result
|
|
210 |
* @param key
|
|
211 |
* @return
|
|
212 |
*/
|
|
213 |
public static int getInt(String nodeQualifier, ITXMResult result, String key) {
|
|
214 |
int defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getInt(key, 0);
|
|
215 |
return getInt(nodeQualifier, result, key, defaultValue);
|
|
216 |
}
|
|
217 |
|
|
218 |
/**
|
200 |
219 |
*
|
201 |
220 |
* @param nodeQualifier
|
202 |
221 |
* @param key
|
|
222 |
* @param defaultValue
|
203 |
223 |
* @return
|
204 |
224 |
*/
|
|
225 |
public static int getInt(String nodeQualifier, String key, int defaultValue) {
|
|
226 |
return getInt(nodeQualifier, null, key, defaultValue);
|
|
227 |
}
|
|
228 |
|
|
229 |
/**
|
|
230 |
*
|
|
231 |
* @param nodeQualifier
|
|
232 |
* @param key
|
|
233 |
* @return
|
|
234 |
*/
|
205 |
235 |
public static int getInt(String nodeQualifier, String key) {
|
206 |
236 |
return getInt(nodeQualifier, null, key);
|
207 |
237 |
}
|
... | ... | |
239 |
269 |
* @param key
|
240 |
270 |
* @return
|
241 |
271 |
*/
|
242 |
|
public static double getDouble(String nodeQualifier, ITXMResult result, String key) {
|
243 |
|
|
244 |
|
double defaultValue = -1;
|
245 |
|
double value = defaultValue;
|
246 |
|
|
|
272 |
public static double getDouble(String nodeQualifier, ITXMResult result, String key, double defaultValue) {
|
247 |
273 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
248 |
|
|
249 |
|
defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getDouble(key, defaultValue);
|
250 |
|
value = scope.getNode(nodeQualifier).getDouble(key, defaultValue);
|
251 |
|
|
252 |
|
return value;
|
|
274 |
return scope.getNode(nodeQualifier).getDouble(key, defaultValue);
|
253 |
275 |
}
|
254 |
276 |
|
|
277 |
/**
|
|
278 |
*
|
|
279 |
* @param nodeQualifier
|
|
280 |
* @param key
|
|
281 |
* @return
|
|
282 |
*/
|
|
283 |
public static double getDouble(String nodeQualifier, String key, double defaultValue) {
|
|
284 |
return getDouble(nodeQualifier, null, key, defaultValue);
|
|
285 |
}
|
255 |
286 |
|
256 |
287 |
/**
|
257 |
288 |
*
|
... | ... | |
260 |
291 |
* @return
|
261 |
292 |
*/
|
262 |
293 |
public static double getDouble(String nodeQualifier, String key) {
|
263 |
|
return getDouble(nodeQualifier, null, key);
|
|
294 |
double defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getDouble(key, 0.0d);
|
|
295 |
return getDouble(nodeQualifier, null, key, defaultValue);
|
264 |
296 |
}
|
265 |
297 |
|
266 |
|
|
267 |
298 |
/**
|
268 |
299 |
*
|
269 |
300 |
* @param result
|
270 |
301 |
* @param key
|
271 |
302 |
* @return
|
272 |
303 |
*/
|
273 |
|
public static double getDouble(ITXMResult result, String key) {
|
274 |
|
return getDouble(null, result, key);
|
|
304 |
public static double getDouble(ITXMResult result, String key, double defaultValue) {
|
|
305 |
return getDouble(null, result, key, defaultValue);
|
275 |
306 |
}
|
276 |
|
|
277 |
|
|
|
307 |
|
278 |
308 |
/**
|
279 |
309 |
* Stores a pairs of key / value in a local node dedicated to the specified result. The node qualifier is generated by the <code>Object.toString()</code> method.
|
280 |
310 |
* @param result
|
... | ... | |
296 |
326 |
* @param key
|
297 |
327 |
* @return
|
298 |
328 |
*/
|
299 |
|
public static float getFloat(String nodeQualifier, ITXMResult result, String key) {
|
|
329 |
public static float getFloat(String nodeQualifier, ITXMResult result, String key, float defaultValue) {
|
300 |
330 |
|
301 |
|
float defaultValue = -1;
|
302 |
|
float value = defaultValue;
|
303 |
|
|
304 |
331 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
305 |
|
|
306 |
|
defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getFloat(key, defaultValue);
|
307 |
|
value = scope.getNode(nodeQualifier).getFloat(key, defaultValue);
|
308 |
|
return value;
|
|
332 |
return scope.getNode(nodeQualifier).getFloat(key, defaultValue);
|
309 |
333 |
}
|
310 |
334 |
|
311 |
335 |
|
312 |
336 |
/**
|
|
337 |
* Looks for the value of the specified <code>key</code> in preference nodes.
|
|
338 |
* Returns the value of the local result node if exists.
|
|
339 |
* Otherwise try to get it from the specified node qualifier if exists.
|
|
340 |
* Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
|
|
341 |
* Returns -1 if no value has been found for the specified key.
|
|
342 |
* @param nodeQualifier
|
|
343 |
* @param result
|
|
344 |
* @param key
|
|
345 |
* @return
|
|
346 |
*/
|
|
347 |
public static float getFloat(String nodeQualifier, ITXMResult result, String key) {
|
|
348 |
|
|
349 |
nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
|
|
350 |
float defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getFloat(key, 0f);
|
|
351 |
return scope.getNode(nodeQualifier).getFloat(key, defaultValue);
|
|
352 |
}
|
|
353 |
|
|
354 |
|
|
355 |
/**
|
313 |
356 |
*
|
314 |
357 |
* @param nodeQualifier
|
315 |
358 |
* @param key
|
316 |
359 |
* @return
|
317 |
360 |
*/
|
318 |
361 |
public static float getFloat(String nodeQualifier, String key) {
|
319 |
|
return getFloat(nodeQualifier, null, key);
|
|
362 |
return getFloat(nodeQualifier, null, key, 0f);
|
320 |
363 |
}
|
321 |
364 |
|
322 |
365 |
|
... | ... | |
327 |
370 |
* @return
|
328 |
371 |
*/
|
329 |
372 |
public static float getFloat(ITXMResult result, String key) {
|
330 |
|
return getFloat(null, result, key);
|
|
373 |
return getFloat(null, result, key, 0f);
|
331 |
374 |
}
|
332 |
375 |
|
333 |
376 |
|