Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/injector/ComputedDischargeInjector.java @ 8251:c7ca9c228314
Added context injectors for discharge curves.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 10 Sep 2014 10:01:11 +0200 |
parents | |
children | e3a8aa6eee32 |
comparison
equal
deleted
inserted
replaced
8240:61fd22f65bd4 | 8251:c7ca9c228314 |
---|---|
1 package org.dive4elements.river.exports.injector; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 import org.dive4elements.artifacts.Artifact; | |
5 import org.dive4elements.artifacts.CallContext; | |
6 import org.dive4elements.artifacts.ContextInjector; | |
7 import org.dive4elements.river.artifacts.D4EArtifact; | |
8 import org.dive4elements.river.artifacts.access.RangeAccess; | |
9 import org.w3c.dom.Document; | |
10 import org.w3c.dom.Element; | |
11 | |
12 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM; | |
13 | |
14 public class ComputedDischargeInjector | |
15 implements ContextInjector | |
16 { | |
17 | |
18 private static Logger log = Logger.getLogger(ComputedDischargeInjector.class); | |
19 | |
20 @Override | |
21 public void setup(Element cfg) { | |
22 } | |
23 | |
24 @Override | |
25 public void injectContext( | |
26 CallContext ctx, | |
27 Artifact artifact, | |
28 Document doc | |
29 ) { | |
30 RangeAccess access = new RangeAccess((D4EArtifact)artifact); | |
31 double km = access.getFrom(); | |
32 ctx.putContextValue(CURRENT_KM, km); | |
33 } | |
34 } |