comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java @ 9178:2f5052835b76

uinfo inundationduration langjÀhr. Mittel, Uedauern.properties, Meldung
author gernotbelger
date Tue, 26 Jun 2018 19:48:35 +0200
parents c265c9fc915c
children dace17e26d33
comparison
equal deleted inserted replaced
9177:37db8c4c44b7 9178:2f5052835b76
17 import org.dive4elements.artifacts.CallContext; 17 import org.dive4elements.artifacts.CallContext;
18 import org.dive4elements.artifacts.CallMeta; 18 import org.dive4elements.artifacts.CallMeta;
19 import org.dive4elements.artifacts.common.utils.XMLUtils; 19 import org.dive4elements.artifacts.common.utils.XMLUtils;
20 import org.dive4elements.river.artifacts.resources.Resources; 20 import org.dive4elements.river.artifacts.resources.Resources;
21 import org.dive4elements.river.artifacts.states.DefaultState; 21 import org.dive4elements.river.artifacts.states.DefaultState;
22 import org.dive4elements.river.artifacts.uinfo.inundationduration.UedauernPropertiesHelper;
22 import org.w3c.dom.Element; 23 import org.w3c.dom.Element;
23 24
24 /** 25 /**
25 * @author Gernot Belger 26 * @author Gernot Belger
26 */ 27 */
52 @Override 53 @Override
53 public boolean validate(final Artifact artifact) throws IllegalArgumentException { 54 public boolean validate(final Artifact artifact) throws IllegalArgumentException {
54 log.debug("CalculationSelect.validate"); 55 log.debug("CalculationSelect.validate");
55 56
56 final UINFOArtifact uinfo = (UINFOArtifact) artifact; 57 final UINFOArtifact uinfo = (UINFOArtifact) artifact;
58 final String calcDebug = uinfo.getCalculationMode().toString();
59 if (calcDebug.equals("uinfo_inundation_duration")) {
60
61 final String river = uinfo.getRiver();
62 if (!UedauernPropertiesHelper.fileExistsForRiver(river)) {
63 throw new IllegalArgumentException("error_river_inundationdur_file_not_found");
64 }
65 }
66
57 /* throws an exception if calculation mode is invalid */ 67 /* throws an exception if calculation mode is invalid */
58 uinfo.getCalculationMode(); 68
59 return true; 69 return true;
60 } 70 }
61 } 71 }

http://dive4elements.wald.intevation.org