FileDocCategorySizeDatePackage
DayTimeDurationDV.javaAPI DocJava SE 6 API2307Tue Jun 10 00:22:42 BST 2008com.sun.org.apache.xerces.internal.impl.dv.xs

DayTimeDurationDV

public class DayTimeDurationDV extends DurationDV
Used to validate the type
xerces.internal
author
Ankit Pasricha, IBM
version
$Id: DayTimeDurationDV.java,v 1.1.4.1 2005/09/06 11:43:02 neerajbj Exp $

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectgetActualValue(java.lang.String content, com.sun.org.apache.xerces.internal.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);