olg.csv.bean.parser.impl
Class DateParser

java.lang.Object
  extended by olg.csv.bean.parser.AbstractParser<Date>
      extended by olg.csv.bean.parser.impl.DateParser

public final class DateParser
extends AbstractParser<Date>

Parser dedicated in parsing String into date.


Constructor Summary
DateParser(String format, Class<? extends Date> concreteClass, Locale locale)
          Constructs a date parser.
 
Method Summary
 boolean checkconcreteClass(Class<?> concreteClass)
          Check if a class is a concrete Date class.
 Date parse(String str)
          Converts a string into a new instance of .
 
Methods inherited from class olg.csv.bean.parser.AbstractParser
getCharacterParser, getConstructorParser, getDateParser, getEnumParser, identifyDefaultParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateParser

public DateParser(String format,
                  Class<? extends Date> concreteClass,
                  Locale locale)
Constructs a date parser.

Parameters:
format - the date format.
concreteClass - Si null, la classe retournée lors du parsing sera Date
locale - the locale to apply to this DateParser. May be null
Method Detail

parse

public Date parse(String str)
Description copied from class: AbstractParser
Converts a string into a new instance of .

Specified by:
parse in class AbstractParser<Date>
Parameters:
str - the string.
Returns:
the new instance of .

checkconcreteClass

public boolean checkconcreteClass(Class<?> concreteClass)
Check if a class is a concrete Date class.

Parameters:
concreteClass - the class to check.
Returns:
true if the class is concrete and is a Date class or has Date class as a super class.


Copyright © 2014. All rights reserved.