org.apache.xerces.impl.dv.xs
Class DurationDV
java.lang.Object
|
+--org.apache.xerces.impl.dv.xs.TypeValidator
|
+--org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
|
+--org.apache.xerces.impl.dv.xs.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,v 1.20 2005/05/06 15:31:14 ankitp Exp $
- Author:
- Elena Litani, Gopal Sharma, SUN Microsystem Inc.
Method Summary |
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. |
protected java.lang.String |
dateToString(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
|
java.lang.Object |
getActualValue(java.lang.String content,
ValidationContext context)
|
protected javax.xml.datatype.Duration |
getDuration(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
|
protected org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData |
parse(java.lang.String str,
int durationType)
Parses, validates and computes normalized version of duration object |
protected double |
parseSecond(java.lang.String buffer,
int start,
int end)
|
Methods inherited from class org.apache.xerces.impl.dv.xs.AbstractDateTimeDV |
append, append, compare, compareOrder, findUTCSign, fQuotient, fQuotient, getAllowedFacets, getDate, getTime, getTimeZone, getXMLGregorianCalendar, getYearMonth, indexOf, isIdentical, isNextCharUTCSign, maxDayInMonthFor, mod, modulo, normalize, parseInt, parseIntYear, parseTimeZone, resetDateObj, saveUnnormalized, validateDateTime |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DURATION_TYPE
public static final int DURATION_TYPE
YEARMONTHDURATION_TYPE
public static final int YEARMONTHDURATION_TYPE
DAYTIMEDURATION_TYPE
public static final int DAYTIMEDURATION_TYPE
DurationDV
public DurationDV()
getActualValue
public java.lang.Object getActualValue(java.lang.String content,
ValidationContext context)
throws InvalidDatatypeValueException
- Overrides:
getActualValue
in class TypeValidator
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 nMnSdurationType
- - 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 durationdate2
- Unnormalized durationstrict
- (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
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
Copyright © 1999-2005 Apache XML Project. All Rights Reserved.