Code example for DatatypeFactory

Methods: newXMLGregorianCalendar

0
 
    public static XMLGregorianCalendar convertDateToXmlGregorianCalendar( Date date ) {
        if( date != null ) {
            GregorianCalendar gregorianCal = new GregorianCalendar();
            gregorianCal.setTime(date);
            return datatypeFactory.newXMLGregorianCalendar(gregorianCal);
        } 
        return null; 
    } 
 
    public static JaxbStringObjectPairArray convertMapToJaxbStringObjectPairArray( Map<String, Object> map ) {
        JaxbStringObjectPairArray arrayMap = new JaxbStringObjectPairArray();
 
        if( map == null || map.isEmpty() ) { 
            return arrayMap;
        } 
        List<JaxbStringObjectPair> items = arrayMap.getItems();
        for( Entry<String, Object> entry : map.entrySet() ) {
            JaxbStringObjectPair pair = new JaxbStringObjectPair();
            pair.setKey(entry.getKey());