org.jasig.schedassist.messaging
Class XMLDataUtils
java.lang.Object
org.jasig.schedassist.messaging.XMLDataUtils
public class XMLDataUtils
- extends Object
This class provides helper methods for converting XMLGregorianCalendar
objects to Dates and vice-versa.
- Version:
- $Id: XMLDataUtils.java 2974 2011-01-25 13:44:23Z npblair $
- Author:
- Nicholas Blair, nblair@doit.wisc.edu
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLDataUtils
public XMLDataUtils()
convertXMLGregorianCalendarToDate
public static Date convertXMLGregorianCalendarToDate(XMLGregorianCalendar calendar)
- Convert the
XMLGregorianCalendar into a Date.
- Parameters:
calendar -
- Returns:
- the converted date
- Throws:
IllegalArgumentException - if input is null
convertDateToXMLGregorianCalendar
public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(Date date)
- Convert the
Date into a XMLGregorianCalendar.
Calls DatatypeFactory.newInstance() - if a DatatypeConfigurationException
is thrown it get's wrapped in the unchecked IllegalStateException.
- Parameters:
date -
- Returns:
- the converted calendar
- Throws:
IllegalStateException - wrapping a DatatypeConfigurationException.
Copyright © 2012 Jasig. All Rights Reserved.