package cnp.ew.converter;
import java.util.*;

/**
 * Converts a string to a string.  Used for embedding literal text in
 * the fields for other string converters.
 *
 * @see cnp.ew.util.CpDateToStringConverter
 *
 * @version        $Version$
 * @author         $Author: Ken $
 */
public class CpStringToString implements CpToStringConverter
{
    String literalString;

    public CpStringToString()
    {
        super();
        literalString = "";
    }

    /**
     * Create a new converter, setting its 'formatting string',
     * which in this case is the text itself.
     */
    public CpStringToString(String newLiteralString) {
        setFormatString(newLiteralString);
    }

    /**
     * Set the formatting string (literal text) for the converter.
     */
    public void setFormatString(String formatString) {
        literalString = formatString;
    }

    /**
     * Convert the given object into a string.  The object is ignored, since
     * the literal text is our formatting string.
     */
    public String convert(Object ignore)
    {
        return literalString;
    }
}

