comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 348:635af5381a4d

Added an abstract OutGenerator that should be the base class for all generators which create charts. flys-artifacts/trunk@1750 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 27 Apr 2011 14:40:44 +0000
parents
children 8830eecad69e
comparison
equal deleted inserted replaced
347:a63d8bdb2d79 348:635af5381a4d
1 package de.intevation.flys.exports;
2
3 import java.io.IOException;
4 import java.io.OutputStream;
5
6 import org.apache.log4j.Logger;
7
8 import org.w3c.dom.Document;
9
10 import de.intevation.artifacts.Artifact;
11 import de.intevation.artifacts.CallContext;
12
13
14 /**
15 * The base class for chart creation. It should provide some basic things that
16 * equal in all chart types.
17 *
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
19 */
20 public abstract class ChartGenerator implements OutGenerator {
21
22 private static Logger logger = Logger.getLogger(ChartGenerator.class);
23
24
25 /** The document of the incoming out() request.*/
26 protected Document request;
27
28 /** The output stream where the data should be written to.*/
29 protected OutputStream out;
30
31 /** The CallContext object.*/
32 protected CallContext context;
33
34
35 public void init(Document request, OutputStream out, CallContext context) {
36 logger.debug("ChartGenerator.init");
37
38 this.request = request;
39 this.out = out;
40 this.context = context;
41 }
42
43
44 public abstract void doOut(Artifact artifact, Document attr);
45
46 public abstract void generate() throws IOException;
47 }
48 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org