ThreeTen / threeten

This project was the home of code used to develop a modern date and time library for JDK8. Development has moved to OpenJDK and a separate backport project, threetenbp.
http://threeten.github.io/
191 stars 37 forks source link

Add missing converters for javax.xml.datatype.XMLGregorianCalendar and Duration #313

Closed geszes closed 11 years ago

geszes commented 11 years ago

Currently there are static factory methods on java.util.Date, GregorianCalendar, and all three SQL types from JSR-310 types, and matching instance methods to produce a JSR-310 type.

However, there are no such conversions provided for the (abstract) XML datatype classes XMLGregorianCalendar and Duration, and the related DatatypeFactory.

JSR-310 should interoperate well with all existing representations of datetime in the JDK. If modifying the Java XML datatype classes is not possible, then JSR-310 classes should provide the conversion capability.

jodastephen commented 11 years ago

I am personally in favour of full integration, but this issue gets determined by Oracle.

RogerRiggs commented 11 years ago

Creating a dependency in java.time on javax.xml.datatype.* would be a bad choice from a modularity point of view. That's a non-starter.
It is reasonable for JAXP to depend on APIs in the core -- compact1 in the context of JEP-161. A change to javax.xml.datatype will need to be done by the JAXP folks. I will add an RFE for it.