net.sourceforge.stripes.validation
Class StringTypeConverter

java.lang.Object
  extended by net.sourceforge.stripes.validation.StringTypeConverter
All Implemented Interfaces:
TypeConverter<String>

public class StringTypeConverter
extends Object
implements TypeConverter<String>

A dummy type converter that targets the String type by simply returning the input String without any modifications.

Since:
Stripes 1.4
Author:
Tim Fennell

Constructor Summary
StringTypeConverter()
           
 
Method Summary
 String convert(String input, Class<? extends String> targetType, Collection<ValidationError> errors)
          Simply returns the input String un-modified in any way.
 void setLocale(Locale locale)
          Does Nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTypeConverter

public StringTypeConverter()
Method Detail

setLocale

public void setLocale(Locale locale)
Does Nothing

Specified by:
setLocale in interface TypeConverter<String>
Parameters:
locale - the locale that the TypeConverter will be converting from.

convert

public String convert(String input,
                      Class<? extends String> targetType,
                      Collection<ValidationError> errors)
Simply returns the input String un-modified in any way.

Specified by:
convert in interface TypeConverter<String>
Parameters:
input - the String being converted
targetType - the Class representing the type of the property to which the return value of the conversion will be assigned. In many cases this can be ignored as converters will return a single type more often than not.
errors - an empty collection of validation errors that should be populated by the converter for any errors that occur during validation that are user input related.
Returns:
T an instance of the converted type, or null if the input cannot be converted


? Copyright 2005-2006, Stripes Development Team.