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

YearMonthDurationDV

public class YearMonthDurationDV extends DurationDV
Used to validate the type
xerces.internal
author
Ankit Pasricha, IBM
version
$Id: YearMonthDurationDV.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.YEARMONTHDURATION_TYPE);
        } 
        catch (Exception ex) {
            throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "yearMonthDuration"});
        }
    
protected javax.xml.datatype.DurationgetDuration(DateTimeData date)

        int sign = 1;
        if ( date.year<0 || date.month<0) {
            sign = -1;
        }
        return factory.newDuration(sign == 1, 
                date.year != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.year):null, 
                date.month != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.month):null, 
                null,
                null,
                null,
                null);