My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 1: Add ability to change DataFormat for DateProcessor
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  skiron...@gmail.com
Closed:  Aug 2012


 
Reported by guram.sa...@gmail.com, Aug 20, 2012
Now it is impossible to change DateFormat in DateProcessor.

ValueProcessorProvider creates DateProcessor uses constructor with DateFormat argument:
registerValueProcessor(Date.class, new DateProcessor(DateFormat.getDateInstance()));

It will be usable to have ability to set DateFormat for java.util.Date format?
Aug 20, 2012
#1 guram.sa...@gmail.com
Remark for last line, it is not question, it is statement:
"It will be usable to have ability to set DateFormat for java.util.Date format."
Aug 20, 2012
#2 guram.sa...@gmail.com
Seems like it is possible to remove DateProcessor added by default in constructor of ValueProcessorProvider.
Then added new DateProcessor with specified DateFormat as argument can be used.
Aug 22, 2012
Project Member #3 skiron...@gmail.com
Yes, you are right. You can register your own Date value processor, as you said:

ValueProcessorProvider vpp = new ValueProcessorProvider();
vpp.removeValueProcessor(Date.class);
vpp.registerValueProcessor(Date.class, new DateProcessor(yourDateFormat));
[...]
CSVReader<Person> csvReader = new CSVReaderBuilder<Person>(csvFile).entryParser(
		new AnnotationEntryParser<Person>(Person.class, vpp)).build();
Aug 22, 2012
Project Member #4 skiron...@gmail.com
Solution in comment 3.
Status: Invalid
Owner: skiron...@gmail.com

Powered by Google Project Hosting