org.vraptor.converter
Class FixedPatternCalendarConverter

java.lang.Object
  extended by org.vraptor.converter.FixedPatternCalendarConverter
All Implemented Interfaces:
Converter

public class FixedPatternCalendarConverter
extends Object
implements Converter

Fixed Locale based calendar converter. Uses the error key invalid_date if unable to parse its information.

Author:
Guilherme Silveira

Constructor Summary
FixedPatternCalendarConverter(String pattern)
          Simple constructor with pattern
 
Method Summary
 Object convert(String value, Class<?> type, LogicRequest context)
          Converts a value to an specific type
 Class<?>[] getSupportedTypes()
          Returns the list of supported types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedPatternCalendarConverter

public FixedPatternCalendarConverter(String pattern)
Simple constructor with pattern

Parameters:
pattern - pattern
Method Detail

convert

public Object convert(String value,
                      Class<?> type,
                      LogicRequest context)
               throws ConversionException
Description copied from interface: Converter
Converts a value to an specific type

Specified by:
convert in interface Converter
Parameters:
value - current value
type - desired type
Returns:
the converted value
Throws:
ConversionException - some convertion problem hapenned
See Also:
org.vraptor.converter.Converter#convert(java.lang.String, java.lang.Class, org.vraptor.scope.LogicRequest)

getSupportedTypes

public Class<?>[] getSupportedTypes()
Description copied from interface: Converter
Returns the list of supported types

Specified by:
getSupportedTypes in interface Converter
Returns:
array of supported types


Copyright © 2004-2008 VRaptor. All Rights Reserved.