net.sourceforge.stripes.validation
Class ShortTypeConverter
java.lang.Object
net.sourceforge.stripes.validation.NumberTypeConverterSupport
net.sourceforge.stripes.validation.ShortTypeConverter
- All Implemented Interfaces:
- TypeConverter<Short>
public class ShortTypeConverter
- extends NumberTypeConverterSupport
- implements TypeConverter<Short>
Basic type converter for converting strings to short integers.
- Author:
- Tim Fennell
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShortTypeConverter
public ShortTypeConverter()
convert
public Short convert(String input,
Class<? extends Short> targetType,
Collection<ValidationError> errors)
- Description copied from interface:
TypeConverter
- Convert a String to the target type supported by this converter.
- Specified by:
convert
in interface TypeConverter<Short>
- Parameters:
input
- errors
- 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.
- Returns:
- Integer an Integer object if one can be parsed from the input
getNumberFormats
protected NumberFormat[] getNumberFormats()
- Overridden to return integer instances instead.
- Overrides:
getNumberFormats
in class NumberTypeConverterSupport
- Returns:
- one or more NumberFormats to use in parsing numbers
? Copyright 2005-2006, Stripes Development Team.