Mercurial > dive4elements > gnv-client
view gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java @ 827:fe0263926870
Removed obsolet SuppressWarnings-Annotations.
gnv-artifacts/trunk@921 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 13 Apr 2010 12:39:16 +0000 |
parents | feae2f9d6c6f |
children | 05bf8534a35a |
line wrap: on
line source
package de.intevation.gnv.state; import de.intevation.artifactdatabase.Config; import de.intevation.artifacts.CallContext; import de.intevation.gnv.state.exception.StateException; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import org.w3c.dom.Element; import org.w3c.dom.Node; /** * This method looks for former inserted coordinates before initialization. * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> */ public class PreSettingsTransferCoordinateSelectionState extends CoordinateSelectionState { /** * The UID of this Class. */ private static final long serialVersionUID = -3972304838976884048L; private String transferPreSettingsName = null; private String transferInputDataname = null; /** * Constructor */ public PreSettingsTransferCoordinateSelectionState() { super(); } /** * Lookup mechanism for former inserted data before intialization begins. * * @param uuid * @param context * @throws StateException */ @Override public void initialize(String uuid, CallContext context) throws StateException { Map<String, InputData> preSettings = this.getPreSettings(); if (preSettings != null){ InputData ip = preSettings.get(transferPreSettingsName); if (ip != null){ Collection<InputData> localInputdata = new ArrayList<InputData>(1); localInputdata.add(new DefaultInputData(transferInputDataname, ip.getValue())); this.putInputData(localInputdata, uuid); } } super.initialize(uuid, context); } /** * * @param configuration */ @Override public void setup(Node configuration) { Element preSettingsNode = (Element)Config.getNodeXPath(configuration, "presettings-transfer"); if (preSettingsNode != null){ this.transferPreSettingsName = preSettingsNode.getAttribute("presetting"); this.transferInputDataname = preSettingsNode.getAttribute("inputvalue"); } super.setup(configuration); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :