Class DurationDV


  • public class DurationDV
    extends AbstractDateTimeDV
    Validator for <duration> datatype (W3C Schema Datatypes)

    INTERNAL:

    Usage of this class is not supported. It may be altered or removed at any time.
    Version:
    $Id: DurationDV.java 937741 2010-04-25 04:25:46Z mrglavas $
    Author:
    Elena Litani, Gopal Sharma, SUN Microsystem Inc.
    • Constructor Detail

      • DurationDV

        public DurationDV()
    • Method Detail

      • parse

        protected org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData parse​(java.lang.String str,
                                                                                     int durationType)
                                                                              throws SchemaDateTimeException
        Parses, validates and computes normalized version of duration object
        Parameters:
        str - The lexical representation of duration object PnYn MnDTnH nMnS
        durationType -
        Returns:
        normalized date representation
        Throws:
        SchemaDateTimeException - Invalid lexical representation
      • compareDates

        protected short compareDates​(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date1,
                                     org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date2,
                                     boolean strict)
        Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")
        Overrides:
        compareDates in class AbstractDateTimeDV
        Parameters:
        date1 - Unnormalized duration
        date2 - Unnormalized duration
        strict - (min/max)Exclusive strict == true ( LESS_THAN ) or ( GREATER_THAN ) (min/max)Inclusive strict == false (LESS_EQUAL) or (GREATER_EQUAL)
        Returns:
        INDETERMINATE if the order relationship between date1 and date2 is indeterminate. EQUAL if the order relation between date1 and date2 is EQUAL. If the strict parameter is true, return LESS_THAN if date1 is less than date2 and return GREATER_THAN if date1 is greater than date2. If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and return GREATER_THAN if date1 is greater than OR equal to date2
      • parseSecond

        protected double parseSecond​(java.lang.String buffer,
                                     int start,
                                     int end)
                              throws java.lang.NumberFormatException
        Overrides:
        parseSecond in class AbstractDateTimeDV
        Throws:
        java.lang.NumberFormatException
      • dateToString

        protected java.lang.String dateToString​(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
        Overrides:
        dateToString in class AbstractDateTimeDV
      • getDuration

        protected javax.xml.datatype.Duration getDuration​(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
        Overrides:
        getDuration in class AbstractDateTimeDV