001 /* 002 * DoNothingFormatter.java 003 * 004 * Copyright (C) 2005 Anupam Sengupta ([email protected]) 005 * 006 * This program is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU General Public License 008 * as published by the Free Software Foundation; either version 2 009 * of the License, or (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 019 * 020 * Version: $Revision: 1.2 $ 021 */ 022 package net.sf.anupam.csv.formatters; 023 024 /** 025 * A <code>No-Op</code> {@link CSVFieldFormatter formatter} that acts as the default if no explicit 026 * formatter is configured for a CSV field. The formatter performs an Identity 027 * operation on the input and returns the same as the <em>"formatted"</em> 028 * result. 029 * <p/> 030 * The declarative name of this formatter is <code>none</code>. 031 * </p> 032 * 033 * @author Anupam Sengupta 034 * @version $Revision: 1.2 $ 035 * @csv.formatter-mapping name="doNothing" 036 * @since 1.5 037 */ 038 final class DoNothingFormatter 039 implements CSVFieldFormatter { 040 041 /** 042 * Constructor for DoNothingFormatter. 043 */ 044 public DoNothingFormatter() { 045 super(); 046 } 047 048 /** 049 * Formats the value and returns the same value. 050 * 051 * @param value the value to be transformed 052 * @return the same value 053 * @see CSVFieldFormatter#format(String) 054 */ 055 public String format(final String value) { 056 057 return value; 058 } 059 060 }