com.anasoft.os.daofusion.util
Class FilterValueConverters.DateConverter

java.lang.Object
  extended by com.anasoft.os.daofusion.util.FilterValueConverters.DateConverter
All Implemented Interfaces:
FilterValueConverter<java.util.Date>
Enclosing class:
FilterValueConverters

public static class FilterValueConverters.DateConverter
extends java.lang.Object
implements FilterValueConverter<java.util.Date>

Date converter with configurable date format pattern.

Author:
vojtech.szocs
See Also:
SimpleDateFormat

Constructor Summary
FilterValueConverters.DateConverter(java.lang.String dateFormatPattern)
          Creates a new converter.
 
Method Summary
 java.util.Date convert(java.lang.String stringValue)
          Converts the given stringValue into appropriate object representation.
 java.lang.String getDateFormatPattern()
           
 java.util.Date parseDate(java.lang.String value, java.lang.String dateFormatPattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterValueConverters.DateConverter

public FilterValueConverters.DateConverter(java.lang.String dateFormatPattern)
Creates a new converter.

Parameters:
dateFormatPattern - Pattern describing the date format.
Method Detail

getDateFormatPattern

public java.lang.String getDateFormatPattern()
Returns:
Pattern describing the date format.

convert

public java.util.Date convert(java.lang.String stringValue)
Description copied from interface: FilterValueConverter
Converts the given stringValue into appropriate object representation.

Sample method implementations:

 return stringValue;
 
 return Integer.valueOf(stringValue);
 
 return Boolean.valueOf(stringValue);
 

Specified by:
convert in interface FilterValueConverter<java.util.Date>
Parameters:
stringValue - String-based filter value received from the FilterAndSortCriteria.
Returns:
Filter value object representation.
See Also:
FilterValueConverter.convert(java.lang.String)

parseDate

public java.util.Date parseDate(java.lang.String value,
                                java.lang.String dateFormatPattern)


Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.