Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/validation/LMesswertValidator.java @ 263:2098db2e8fbd M1
Code documentation.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 17 Jul 2013 09:40:53 +0200 |
parents | 0de24f5e7c01 |
children | 183f8116d9a6 |
comparison
equal
deleted
inserted
replaced
262:f4b359aa9127 | 263:2098db2e8fbd |
---|---|
11 @Named("lmesswertvalidator") | 11 @Named("lmesswertvalidator") |
12 @ApplicationScoped | 12 @ApplicationScoped |
13 public class LMesswertValidator | 13 public class LMesswertValidator |
14 implements Validator | 14 implements Validator |
15 { | 15 { |
16 | 16 /** |
17 * Validate a LMesswert object. | |
18 * | |
19 * @param object The LMesswert object. | |
20 * @param update The database operation. | |
21 * TRUE indicates that the object should be updated, FALSE | |
22 * if the object is a new Object. | |
23 * @return Map containing warnings. | |
24 */ | |
17 @Override | 25 @Override |
18 public Map<String, Integer> validate(Object object, boolean update) | 26 public Map<String, Integer> validate(Object object, boolean update) |
19 throws ValidationException { | 27 throws ValidationException { |
20 Map<String, Integer> warnings = new HashMap<String, Integer>(); | 28 Map<String, Integer> warnings = new HashMap<String, Integer>(); |
21 if (!(object instanceof LMesswert)) { | 29 if (!(object instanceof LMesswert)) { |
27 | 35 |
28 validateMessunsicherheit(messwert, warnings); | 36 validateMessunsicherheit(messwert, warnings); |
29 return null; | 37 return null; |
30 } | 38 } |
31 | 39 |
40 /** | |
41 * Check if the LMesswert has a 'Messunsicherheit' or if the the value | |
42 * is lower than the 'Nachweisgrenze'. | |
43 * | |
44 * @param messwert The LMesswert object. | |
45 * @param warnings The map containing warnings. | |
46 * @throws ValidationException | |
47 */ | |
32 private void validateMessunsicherheit( | 48 private void validateMessunsicherheit( |
33 LMesswert messwert, | 49 LMesswert messwert, |
34 Map<String, Integer> warnings) | 50 Map<String, Integer> warnings) |
35 throws ValidationException { | 51 throws ValidationException { |
36 Float unsicherheit = messwert.getMessfehler(); | 52 Float unsicherheit = messwert.getMessfehler(); |