comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java @ 1176:28154920e0b3

Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact. flys-artifacts/trunk@2761 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 15 Sep 2011 15:05:24 +0000
parents fb5a7ff9feb8
children 1aba1a75beb2
comparison
equal deleted inserted replaced
1175:e6b513495281 1176:28154920e0b3
20 import de.intevation.artifacts.common.utils.XMLUtils; 20 import de.intevation.artifacts.common.utils.XMLUtils;
21 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; 21 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
22 22
23 import de.intevation.artifactdatabase.ProtocolUtils; 23 import de.intevation.artifactdatabase.ProtocolUtils;
24 24
25 import de.intevation.artifactdatabase.data.DefaultStateData;
25 import de.intevation.artifactdatabase.data.StateData; 26 import de.intevation.artifactdatabase.data.StateData;
26 27
27 import de.intevation.artifactdatabase.state.AbstractState; 28 import de.intevation.artifactdatabase.state.AbstractState;
28 import de.intevation.artifactdatabase.state.Facet; 29 import de.intevation.artifactdatabase.state.Facet;
29 30
257 return null; 258 return null;
258 } 259 }
259 260
260 261
261 /** 262 /**
263 * This method transform a given value into a StateData object.
264 *
265 * @param flys The FLYSArtifact.
266 * @param name The name of the data object.
267 * @param val The value of the data object.
268 *
269 * @return a StateData object with <i>name</i> and <i>val</i>ue.
270 */
271 public StateData transform(
272 FLYSArtifact flys,
273 CallContext cc,
274 String name,
275 String val
276 ) {
277 logger.debug("Transform data ('" + name + "','" + val + "')");
278 return new DefaultStateData(name, null, null, val);
279 }
280
281
282 /**
262 * This method validates the inserted data and returns true, if everything 283 * This method validates the inserted data and returns true, if everything
263 * was correct, otherwise an exception is thrown. 284 * was correct, otherwise an exception is thrown.
264 * 285 *
265 * @param artifact A reference to the owner artifact. 286 * @param artifact A reference to the owner artifact.
266 * 287 *

http://dive4elements.wald.intevation.org