Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.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 | f28a7eac542a |
children | 9a828e5a2390 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java Wed Mar 24 15:32:07 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java Thu Mar 25 09:01:14 2010 +0000 @@ -14,20 +14,43 @@ import de.intevation.gnv.state.exception.StateException; /** - * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) - * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + * This class is the default implementation of {@link Export}. + * + * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DefaultExport implements Export { + /** + * Logger used for logging via log4j. + */ private static Logger log = Logger.getLogger(DefaultExport.class); + /** + * DataCollector used to extract data from <code>Result</code> objects. + */ protected Export.DataCollector collector; + /** + * Constructor + * + * @param collector See {@link #collector} + */ public DefaultExport(Export.DataCollector collector) { this.collector = collector; } + /** + * This method writes data stored in <code>result</code> into a CSV document + * using <code>writer</code>. + * + * @param profile {@link #Profile} used to specify the format and columns. + * @param result Collection storing the required data. + * @param writer CSVWriter to write the csv document. + * + * @throws StateException + */ protected void writeData( Profile profile, Collection result, @@ -48,6 +71,20 @@ } } + /** + * This method takes a data Collection and writes it to + * <code>outputStream</code> using the the format specified by + * <code>profile</code>. + * + * @param profile used to specify the format and columns. + * @param outputStream OutputStream which is used for writing the export + * document to. + * @param result Collection storing the data. + * + * @throws IOException if writing to OutputStream failed. + * @throws UnsupportedEncodingException if the encoding was not accepted. + * @throws StateException if result is null. + */ public void create( Profile profile, OutputStream outputStream, @@ -78,3 +115,4 @@ writer.close(); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :