Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java @ 875:5e9efdda6894
merged gnv-artifacts/1.0
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:56 +0200 |
parents | 9a828e5a2390 |
children | f953c9a559d8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,151 @@ +package de.intevation.gnv.exports; + +/** + * This class is the default implementation of {@link Export.Profile} and + * serves information about the format used to create an export document. + * + * @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 DefaultProfile +implements Export.Profile +{ + /** + * Used to collect the required data from <code>Result</code> object. + */ + protected Export.DataCollector collector; + + /** + * Column headers. + */ + protected String [] header; + + /** + * + */ + protected String [] names; + + /** + * Character used to separate columns. + */ + protected char separator; + + /** + * Escape character. + */ + protected char escapeCharacter; + + /** + * Quote character. + */ + protected char quoteCharacter; + + /** + * Format type. + */ + protected String type; + + /** + * Encoding used for export. + */ + protected String encoding; + + /** + * Constructor + */ + private DefaultProfile() { + } + + /** + * Constructor + * + * @param header See {@link #header} + * @param separator See {@link #separator} + * @param escapeCharacter See {@link #escapeCharacter} + * @param quoteCharacter See {@link #quoteCharacter} + * @param type See {@link #type} + * @param encoding See {@link #encoding} + */ + public DefaultProfile( + String [] header, + char separator, + char escapeCharacter, + char quoteCharacter, + String type, + String encoding + ) { + this.header = header; + this.separator = separator; + this.escapeCharacter = escapeCharacter; + this.quoteCharacter = quoteCharacter; + this.type = type; + this.encoding = encoding; + } + + /** + * Returns the given value. + * + * @param index Index + * @param value Value + * + * @return value + */ + public String toString(int index, String value) { + return value; + } + + /** + * Returns the separator. + * + * @return Separator + */ + public char getSeparator() { + return separator; + } + + /** + * Returns the escape character. + * + * @return Escape character + */ + public char getEscapeCharacter() { + return escapeCharacter; + } + + /** + * Returns the quote character. + * + * @return Quote character. + */ + public char getQuoteCharacter() { + return quoteCharacter; + } + + /** + * Returns the format type. + * + * @return Type. + */ + public String getType() { + return type; + } + + /** + * Returns the encoding. + * + * @return Encoding + */ + public String getEncoding() { + return encoding; + } + + /** + * Returns the column headers. + * + * @return header + */ + public String[] getHeader() { + return header; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :