01: /*
02: * DoNothingFormatter.java
03: *
04: * Copyright (C) 2005 Anupam Sengupta (anupamsg@users.sourceforge.net)
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19: *
20: * Version: $Revision: 1.2 $
21: */
22: package net.sf.anupam.csv.formatters;
23:
24: /**
25: * A <code>No-Op</code> {@link CSVFieldFormatter formatter} that acts as the default if no explicit
26: * formatter is configured for a CSV field. The formatter performs an Identity
27: * operation on the input and returns the same as the <em>"formatted"</em>
28: * result.
29: * <p/>
30: * The declarative name of this formatter is <code>none</code>.
31: * </p>
32: *
33: * @author Anupam Sengupta
34: * @version $Revision: 1.2 $
35: * @csv.formatter-mapping name="doNothing"
36: * @since 1.5
37: */
38: final class DoNothingFormatter implements CSVFieldFormatter {
39:
40: /**
41: * Constructor for DoNothingFormatter.
42: */
43: public DoNothingFormatter() {
44: super ();
45: }
46:
47: /**
48: * Formats the value and returns the same value.
49: *
50: * @param value the value to be transformed
51: * @return the same value
52: * @see CSVFieldFormatter#format(String)
53: */
54: public String format(final String value) {
55:
56: return value;
57: }
58:
59: }
|