Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/validation/LOrtValidator.java @ 366:567ce7697fc7 0.5
Code documentation.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 10 Sep 2013 15:55:54 +0200 |
parents | f3c58d3c4bc7 |
children | f3d0894d9bfc |
comparison
equal
deleted
inserted
replaced
365:fab80595ed55 | 366:567ce7697fc7 |
---|---|
20 import de.intevation.lada.model.LOrt; | 20 import de.intevation.lada.model.LOrt; |
21 import de.intevation.lada.model.Ort; | 21 import de.intevation.lada.model.Ort; |
22 import de.intevation.lada.model.SVerwaltungseinheit; | 22 import de.intevation.lada.model.SVerwaltungseinheit; |
23 import de.intevation.lada.rest.Response; | 23 import de.intevation.lada.rest.Response; |
24 | 24 |
25 /** | |
26 * Validator for LOrt objects. | |
27 * | |
28 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> | |
29 */ | |
25 @ApplicationScoped | 30 @ApplicationScoped |
26 @Named("lortvalidator") | 31 @Named("lortvalidator") |
27 public class LOrtValidator | 32 public class LOrtValidator |
28 implements Validator | 33 implements Validator |
29 { | 34 { |
57 validateVerwaltungseinheit(ort, warnings); | 62 validateVerwaltungseinheit(ort, warnings); |
58 //TODO: more validation, see LSB: VI - Konsistenzregeln | 63 //TODO: more validation, see LSB: VI - Konsistenzregeln |
59 return warnings; | 64 return warnings; |
60 } | 65 } |
61 | 66 |
67 /** | |
68 * Check if the given lat/lon coordinates are within the area of the | |
69 * verwaltungseinheit. | |
70 * | |
71 * @param ort | |
72 * @param warnings | |
73 */ | |
62 private void validateVerwaltungseinheit(LOrt ort, Map<String, Integer> warnings) { | 74 private void validateVerwaltungseinheit(LOrt ort, Map<String, Integer> warnings) { |
63 if (!ort.getOrtsTyp().equals("E")) { | 75 if (!ort.getOrtsTyp().equals("E")) { |
64 return; | 76 return; |
65 } | 77 } |
66 QueryBuilder<Ort> ortBuilder = | 78 QueryBuilder<Ort> ortBuilder = |