Created
July 10, 2015 07:54
-
-
Save Kotlin-Native/da862aac1801de23baab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); | |
| ... | |
| @Override | |
| public XMLGregorianCalendar unmarshal(String value)throws Exception { | |
| ... | |
| Date date=format.parse(value); | |
| GregorianCalendar calendar=new GregorianCalendar(); | |
| calendar.setTime(date); | |
| return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar); | |
| ... | |
| } | |
| @Override | |
| public String marshal(XMLGregorianCalendar value)throws Exception { | |
| return format.format(value.toGregorianCalendar().getTime()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment