comparison artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java @ 8636:7d1a32a543cb

(issue1755) Extend validation to allow localized error messages.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 27 Mar 2015 16:54:56 +0100
parents a63825ab9df9
children af415396d9ca
comparison
equal deleted inserted replaced
8635:c421c9530aba 8636:7d1a32a543cb
1076 log.debug("Removed data '" + name + "' successfully."); 1076 log.debug("Removed data '" + name + "' successfully.");
1077 } 1077 }
1078 } 1078 }
1079 } 1079 }
1080 1080
1081 current.validate(this); 1081 current.validate(this, context);
1082 } 1082 }
1083 1083
1084 1084
1085 /** 1085 /**
1086 * Determines if the state with the identifier <i>stateId</i> is reachable 1086 * Determines if the state with the identifier <i>stateId</i> is reachable
1258 */ 1258 */
1259 public List<Output> getCurrentOutputs(Object context) { 1259 public List<Output> getCurrentOutputs(Object context) {
1260 DefaultState cur = (DefaultState) getCurrentState(context); 1260 DefaultState cur = (DefaultState) getCurrentState(context);
1261 1261
1262 try { 1262 try {
1263 if (cur.validate(this)) { 1263 if (context instanceof CallContext) {
1264 return getOutputForState(cur); 1264 /* should be always true */
1265 } 1265 CallContext cc = (CallContext) context;
1266 cur.validate(this, cc);
1267 }
1268 return getOutputForState(cur);
1266 } 1269 }
1267 catch (IllegalArgumentException iae) { } 1270 catch (IllegalArgumentException iae) { }
1268 1271
1269 return new ArrayList<Output>(); 1272 return new ArrayList<Output>();
1270 } 1273 }

http://dive4elements.wald.intevation.org