public class

DurationDV

extends AbstractDateTimeDV
java.lang.Object
   ↳ org.apache.xerces.impl.dv.xs.TypeValidator
     ↳ org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
       ↳ org.apache.xerces.impl.dv.xs.DurationDV

Class Overview

Validator for <duration> datatype (W3C Schema Datatypes)

Summary

Constants
int DAYTIMEDURATION_TYPE
int DURATION_TYPE
int YEARMONTHDURATION_TYPE
[Expand]
Inherited Constants
From class org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
From class org.apache.xerces.impl.dv.xs.TypeValidator
[Expand]
Inherited Fields
From class org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
Public Constructors
DurationDV()
Public Methods
Object getActualValue(String content, ValidationContext context)
Protected Methods
short compareDates(AbstractDateTimeDV.DateTimeData date1, AbstractDateTimeDV.DateTimeData date2, boolean strict)
Compares 2 given durations.
String dateToString(AbstractDateTimeDV.DateTimeData date)
Duration getDuration(AbstractDateTimeDV.DateTimeData date)
AbstractDateTimeDV.DateTimeData parse(String str, int durationType)
Parses, validates and computes normalized version of duration object
double parseSecond(String buffer, int start, int end)
[Expand]
Inherited Methods
From class org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
From class org.apache.xerces.impl.dv.xs.TypeValidator
From class java.lang.Object

Constants

public static final int DAYTIMEDURATION_TYPE

Constant Value: 2 (0x00000002)

public static final int DURATION_TYPE

Constant Value: 0 (0x00000000)

public static final int YEARMONTHDURATION_TYPE

Constant Value: 1 (0x00000001)

Public Constructors

public DurationDV ()

Public Methods

public Object getActualValue (String content, ValidationContext context)

Protected Methods

protected short compareDates (AbstractDateTimeDV.DateTimeData date1, AbstractDateTimeDV.DateTimeData date2, boolean strict)

Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")

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

protected String dateToString (AbstractDateTimeDV.DateTimeData date)

protected Duration getDuration (AbstractDateTimeDV.DateTimeData date)

protected AbstractDateTimeDV.DateTimeData parse (String str, int durationType)

Parses, validates and computes normalized version of duration object

Parameters
str The lexical representation of duration object PnYn MnDTnH nMnS
Returns
  • normalized date representation
Throws
SchemaDateTimeException Invalid lexical representation

protected double parseSecond (String buffer, int start, int end)