Here you can find the source of toDate(final XMLGregorianCalendar xml)
Parameter | Description |
---|---|
xml | The XML calendar to convert to a date, or null . |
public static Date toDate(final XMLGregorianCalendar xml)
//package com.java2s; /*//from ww w. j av a2s. c o m * Geotoolkit.org - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2009-2012, Open Source Geospatial Foundation (OSGeo) * (C) 2009-2012, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import java.util.Date; import javax.xml.datatype.XMLGregorianCalendar; public class Main { /** * Converts the given XML Gregorian calendar to a date. * * @param xml The XML calendar to convert to a date, or {@code null}. * @return The date, or {@code null} if {@code xml} was null. * * @since 3.03 */ public static Date toDate(final XMLGregorianCalendar xml) { if (xml != null) { return xml.toGregorianCalendar().getTime(); } return null; } }