olg.csv.bean.parser.impl
Class DateParser

Package class diagram package 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.


Field Summary
private  Class<? extends Date> concreteClass
          The concrete class the parser must return.
private  Constructor<? extends Date> constructor
          the date constructor to invoke on parsing.
private  DateFormat dateFormat
          the date format to use to parse string as date.
private static org.slf4j.Logger LOGGER
          the class Logger.
 
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
 

Field Detail

LOGGER

private static final org.slf4j.Logger LOGGER
the class Logger.


dateFormat

private final DateFormat dateFormat
the date format to use to parse string as date.


concreteClass

private Class<? extends Date> concreteClass
The concrete class the parser must return.


constructor

private Constructor<? extends Date> constructor
the date constructor to invoke on parsing.

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.