net.sourceforge.stripes.validation
Class ObjectTypeConverter

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

public class ObjectTypeConverter
extends Object
implements TypeConverter<Object>

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

Since:
Stripes 1.4
Author:
Tim Fennell

Constructor Summary
ObjectTypeConverter()
           
 
Method Summary
 Object convert(String input, Class<? extends Object> targetType, Collection<ValidationError> errors)
          Simple 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

ObjectTypeConverter

public ObjectTypeConverter()
Method Detail

setLocale

public void setLocale(Locale locale)
Does Nothing

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

convert

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

Specified by:
convert in interface TypeConverter<Object>
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.