Edit
Observation: this question was answered in stack overflow
Edit
Observation: this question was answered in stack overflow
this is my first questions here.
I am facing a issue with aan API to handle Datesdates in JAVAJava. I am not a very experienced programmer and my englishEnglish is very bad.
PlataformPlatform
- The front end is a JSF page with RichFaces
RichFaces
- The application generate reports with JasperReports
JasperReports
- The back end is a Spring 3.1 Application
- Is desirable to support Calendar
Calendar
and XMLGregorianCalendarXMLGregorianCalendar
(for Jaxb2 Serialization)
Code
- I made the methods stringToDate
stringToDate
, dateToStringdateToString
and init as synchronized because SimpleDateFormatSimpleDateFormat
is not thread-safe, and I only want one initialization. - I made the DateFormat
DateFormat
not lenient because I don't want to handle wrong format dates - The methods names are for enhance readability (as* always return a String, and parse* always return a Date).
Thanks for reading, and sorry for my bad English, Any suggestions is welcome
this is my first questions here.
I am facing a issue with a API to handle Dates in JAVA. I am not a very experienced programmer and my english is very bad.
Plataform
- The front end is a JSF page with RichFaces
- The application generate reports with JasperReports
- The back end is a Spring 3.1 Application
- Is desirable to support Calendar and XMLGregorianCalendar (for Jaxb2 Serialization)
Code
- I made the methods stringToDate, dateToString and init as synchronized because SimpleDateFormat is not thread-safe, and I only want one initialization.
- I made the DateFormat not lenient because I don't want to handle wrong format dates
- The methods names are for enhance readability (as* always return a String, and parse* always return a Date).
Thanks for reading, and sorry for my bad English, Any suggestions is welcome
I am facing a issue with an API to handle dates in Java. I am not a very experienced programmer and my English is very bad.
Platform
- The front end is a JSF page with
RichFaces
- The application generate reports with
JasperReports
- The back end is a Spring 3.1 Application
- Is desirable to support
Calendar
andXMLGregorianCalendar
(for Jaxb2 Serialization)
- I made the methods
stringToDate
,dateToString
and init as synchronized becauseSimpleDateFormat
is not thread-safe, and I only want one initialization. - I made the
DateFormat
not lenient because I don't want to handle wrong format dates - The methods names are for enhance readability (as* always return a String, and parse* always return a Date).