Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java @ 771:a0e63136954e
Added and repaired javadoc in de.intevation.gnv.exports package.
gnv-artifacts/trunk@827 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 25 Mar 2010 09:01:14 +0000 |
parents | e964a3d8f7bc |
children | b1f5f2a8840f |
comparison
equal
deleted
inserted
replaced
770:d70cac2bafc0 | 771:a0e63136954e |
---|---|
9 import de.intevation.gnv.geobackend.base.ResultDescriptor; | 9 import de.intevation.gnv.geobackend.base.ResultDescriptor; |
10 import de.intevation.gnv.state.exception.StateException; | 10 import de.intevation.gnv.state.exception.StateException; |
11 | 11 |
12 | 12 |
13 /** | 13 /** |
14 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) | 14 * This is the default implementation of {@link Export.DataCollector}. This |
15 * class serves a method to extract required data from <code>Result</code> | |
16 * objects. | |
17 * | |
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
15 */ | 19 */ |
16 public class DefaultDataCollector | 20 public class DefaultDataCollector |
17 implements Export.DataCollector | 21 implements Export.DataCollector |
18 { | 22 { |
23 /** | |
24 * Logger used to log via log4j. | |
25 */ | |
19 private Logger log = Logger.getLogger(DefaultDataCollector.class); | 26 private Logger log = Logger.getLogger(DefaultDataCollector.class); |
20 | 27 |
28 /** | |
29 * ResultDescriptor used to extract specific attributes from | |
30 * <code>Result</code> object. | |
31 */ | |
21 protected ResultDescriptor rd; | 32 protected ResultDescriptor rd; |
33 | |
34 /** | |
35 * Atrribute names in <code>Result</code> object which should be used for | |
36 * data extraction. | |
37 */ | |
22 protected String [] names; | 38 protected String [] names; |
23 | 39 |
24 | 40 |
41 /** | |
42 * Constructor | |
43 * | |
44 * @param names See {@link #names} | |
45 */ | |
25 public DefaultDataCollector(String[] names) { | 46 public DefaultDataCollector(String[] names) { |
26 this.names = names; | 47 this.names = names; |
27 } | 48 } |
28 | 49 |
50 /** | |
51 * This method initializes the <code>ResultDescriptor</code> rd for a faster | |
52 * data extraction. | |
53 * | |
54 * @param res A <code>Result</code> object used to get its description. | |
55 */ | |
29 public void init(Result res) { | 56 public void init(Result res) { |
30 rd = res.getResultDescriptor(); | 57 rd = res.getResultDescriptor(); |
31 } | 58 } |
32 | 59 |
60 /** | |
61 * This method is used to extract the required data specified by {@link | |
62 * #names}. | |
63 * | |
64 * @param result <code>Result</code> object. | |
65 * | |
66 * @return Extracted data. | |
67 */ | |
33 public String[] getData(Result result) | 68 public String[] getData(Result result) |
34 throws StateException { | 69 throws StateException { |
35 | 70 |
36 if (rd == null) | 71 if (rd == null) |
37 init(result); | 72 init(result); |
44 } | 79 } |
45 | 80 |
46 return (String[]) entries.toArray((new String[entries.size()])); | 81 return (String[]) entries.toArray((new String[entries.size()])); |
47 } | 82 } |
48 } | 83 } |
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |