Code example for DatatypeFactory

Methods: newDuration

0
    private DurationAndDateUtil() { 
 
    } 
 
    public static Duration parseDuration(String input) throws IllegalArgumentException {
        return factory.newDuration(input);
    } 
 
    public static XMLGregorianCalendar parseXMLGregorianCalendar(String input)
        throws IllegalArgumentException {
        return factory.newXMLGregorianCalendar(input);
    } 
 
    public static boolean isXMLGregorianCalendar(String input) {
        try { 
            factory.newXMLGregorianCalendar(input);
            return true; 
        } catch (IllegalArgumentException ex) {
            return false; 
        }