FileDocCategorySizeDatePackage
DayTimeDurationDV.javaAPI DocApache Xerces 3.0.12491Fri Sep 14 20:33:54 BST 2007org.apache.xerces.impl.dv.xs

DayTimeDurationDV

public class DayTimeDurationDV extends DurationDV
Used to validate the type
xerces.internal
author
Ankit Pasricha, IBM
version
$Id: DayTimeDurationDV.java 446745 2006-09-15 21:43:58Z mrglavas $

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectgetActualValue(java.lang.String content, org.apache.xerces.impl.dv.ValidationContext context)

        try {
            return parse(content, DurationDV.DAYTIMEDURATION_TYPE);
        } 
        catch (Exception ex) {
            throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "dayTimeDuration"});
        }
    
protected javax.xml.datatype.DurationgetDuration(DateTimeData date)

        int sign = 1;
        if (date.day<0 || date.hour<0 || date.minute<0 || date.second<0) {
            sign = -1;
        }
        return factory.newDuration(sign == 1, null, null, 
                date.day != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.day):null, 
                date.hour != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.hour):null, 
                date.minute != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.minute):null, 
                date.second != DatatypeConstants.FIELD_UNDEFINED?new BigDecimal(String.valueOf(sign*date.second)):null);