Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.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 | 9a828e5a2390 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java Wed Mar 24 15:32:07 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java Thu Mar 25 09:01:14 2010 +0000 @@ -10,26 +10,104 @@ import de.intevation.gnv.state.exception.StateException; /** - * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) - * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + * This interface should be implemented by a class whose instances are intended + * to export a <code>Collection</code> of <code>Result</code>s into a specific + * format (e.g. CSV or ODV). + * + * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public interface Export { + /** + * This interface provides some methods which describe the format used by an + * <code>Export</code>. + */ public interface Profile { String toString(int column, String value); + + /** + * This method serves information about the character used to separate + * columns. + * + * @return Character used to separate + */ char getSeparator(); + + /** + * This method serves information about the character used as escape + * character. + * + * @return Escape character + */ char getEscapeCharacter(); + + /** + * This method serves informatin about the character used as quote + * character. + * + * @return Quote character + */ char getQuoteCharacter(); + + /** + * This method serves information about the format. + * + * @return Format as string. + */ String getType(); + + /** + * This method serves information about the encoding to be used. + * + * @return Encoding + */ String getEncoding(); + + /** + * This method returns the header as array. + * + * @return Header as string array. + */ String [] getHeader(); } + /** + * This interface should be implemeted to collect the required data from + * <code>Result</code> object. + */ public interface DataCollector { + + /** + * This method serves the required data stored in a <code>Result</code> + * object. + * + * @return String[] which contains all required data. + * + * @throws StateException + */ String[] getData(Result result) throws StateException; } + /** + * This method creates an export document specified by {@link Profile} which + * contains the data stored in <code>result</code> and writes it to + * <code>outputStream</code>. + * + * @param profile Profile used to specify the format of the resulting export + * document. + * @param outputStream Resulting export document is written to this + * OutputStream. + * @param result Collection which contains the data used to be written into + * the export document. + * + * @throws IOException if an error occured while writing the export document + * to OutputStream + * @throws UnsupportedEncodingException if the given encoding is not + * accepted + * @throws StateException if <code>result</code> is null + */ public void create( Profile profile, OutputStream outputStream, @@ -38,3 +116,4 @@ throws IOException, UnsupportedEncodingException, StateException; } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :