Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
722:bb3ffe7d719e | 875:5e9efdda6894 |
---|---|
1 package de.intevation.gnv.exports; | |
2 | |
3 /** | |
4 * This class is the default implementation of {@link Export.Profile} and | |
5 * serves information about the format used to create an export document. | |
6 * | |
7 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
9 */ | |
10 public class DefaultProfile | |
11 implements Export.Profile | |
12 { | |
13 /** | |
14 * Used to collect the required data from <code>Result</code> object. | |
15 */ | |
16 protected Export.DataCollector collector; | |
17 | |
18 /** | |
19 * Column headers. | |
20 */ | |
21 protected String [] header; | |
22 | |
23 /** | |
24 * | |
25 */ | |
26 protected String [] names; | |
27 | |
28 /** | |
29 * Character used to separate columns. | |
30 */ | |
31 protected char separator; | |
32 | |
33 /** | |
34 * Escape character. | |
35 */ | |
36 protected char escapeCharacter; | |
37 | |
38 /** | |
39 * Quote character. | |
40 */ | |
41 protected char quoteCharacter; | |
42 | |
43 /** | |
44 * Format type. | |
45 */ | |
46 protected String type; | |
47 | |
48 /** | |
49 * Encoding used for export. | |
50 */ | |
51 protected String encoding; | |
52 | |
53 /** | |
54 * Constructor | |
55 */ | |
56 private DefaultProfile() { | |
57 } | |
58 | |
59 /** | |
60 * Constructor | |
61 * | |
62 * @param header See {@link #header} | |
63 * @param separator See {@link #separator} | |
64 * @param escapeCharacter See {@link #escapeCharacter} | |
65 * @param quoteCharacter See {@link #quoteCharacter} | |
66 * @param type See {@link #type} | |
67 * @param encoding See {@link #encoding} | |
68 */ | |
69 public DefaultProfile( | |
70 String [] header, | |
71 char separator, | |
72 char escapeCharacter, | |
73 char quoteCharacter, | |
74 String type, | |
75 String encoding | |
76 ) { | |
77 this.header = header; | |
78 this.separator = separator; | |
79 this.escapeCharacter = escapeCharacter; | |
80 this.quoteCharacter = quoteCharacter; | |
81 this.type = type; | |
82 this.encoding = encoding; | |
83 } | |
84 | |
85 /** | |
86 * Returns the given value. | |
87 * | |
88 * @param index Index | |
89 * @param value Value | |
90 * | |
91 * @return value | |
92 */ | |
93 public String toString(int index, String value) { | |
94 return value; | |
95 } | |
96 | |
97 /** | |
98 * Returns the separator. | |
99 * | |
100 * @return Separator | |
101 */ | |
102 public char getSeparator() { | |
103 return separator; | |
104 } | |
105 | |
106 /** | |
107 * Returns the escape character. | |
108 * | |
109 * @return Escape character | |
110 */ | |
111 public char getEscapeCharacter() { | |
112 return escapeCharacter; | |
113 } | |
114 | |
115 /** | |
116 * Returns the quote character. | |
117 * | |
118 * @return Quote character. | |
119 */ | |
120 public char getQuoteCharacter() { | |
121 return quoteCharacter; | |
122 } | |
123 | |
124 /** | |
125 * Returns the format type. | |
126 * | |
127 * @return Type. | |
128 */ | |
129 public String getType() { | |
130 return type; | |
131 } | |
132 | |
133 /** | |
134 * Returns the encoding. | |
135 * | |
136 * @return Encoding | |
137 */ | |
138 public String getEncoding() { | |
139 return encoding; | |
140 } | |
141 | |
142 /** | |
143 * Returns the column headers. | |
144 * | |
145 * @return header | |
146 */ | |
147 public String[] getHeader() { | |
148 return header; | |
149 } | |
150 } | |
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |