KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > anupam > csv > formatters > DoNothingFormatter


1 /*
2  * DoNothingFormatter.java
3  *
4  * Copyright (C) 2005 Anupam Sengupta (anupamsg@users.sourceforge.net)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * 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
39         implements CSVFieldFormatter {
40
41     /**
42      * Constructor for DoNothingFormatter.
43      */

44     public DoNothingFormatter() {
45         super();
46     }
47
48     /**
49      * Formats the value and returns the same value.
50      *
51      * @param value the value to be transformed
52      * @return the same value
53      * @see CSVFieldFormatter#format(String)
54      */

55     public String JavaDoc format(final String JavaDoc value) {
56
57         return value;
58     }
59
60 }
61
Popular Tags