| java.lang.Object org.apache.xerces.impl.dv.xs.TypeValidator org.apache.xerces.impl.dv.xs.AbstractDateTimeDV
All known Subclasses: org.apache.xerces.impl.dv.xs.DateTimeDV, org.apache.xerces.impl.dv.xs.MonthDayDV, org.apache.xerces.impl.dv.xs.DurationDV, org.apache.xerces.impl.dv.xs.YearMonthDV, org.apache.xerces.impl.dv.xs.TimeDV, org.apache.xerces.impl.dv.xs.MonthDV, org.apache.xerces.impl.dv.xs.DayDV, org.apache.xerces.impl.dv.xs.YearDV,
AbstractDateTimeDV | abstract public class AbstractDateTimeDV extends TypeValidator (Code) | | This is the base class of all date/time datatype validators.
It implements common code for parsing, validating and comparing datatypes.
Classes that extend this class, must implement parse() method.
REVISIT: There are many instance variables, which would cause problems
when we support grammar caching. A grammar is possibly used by
two parser instances at the same time, then the same simple type
decl object can be used to validate two strings at the same time.
-SG
author: Elena Litani author: Len Berman author: Gopal Sharma, SUN Microsystems Inc. version: $Id: AbstractDateTimeDV.java 572095 2007-09-02 18:32:43Z mrglavas $ |
Inner Class :final static class DateTimeData implements XSDateTime | |
Method Summary | |
final protected void | append(StringBuffer message, int value, int nch) | final protected void | append(StringBuffer message, double value) | final protected void | append2(StringBuffer message, double value) | public int | compare(Object value1, Object value2) | protected short | compareDates(DateTimeData date1, DateTimeData date2, boolean strict) Compare algorithm described in dateDime (3.2.7). | protected short | compareOrder(DateTimeData date1, DateTimeData date2) Given normalized values, determines order-relation
between give date/time objects. | protected String | dateToString(DateTimeData date) | protected int | fQuotient(int a, int b) | protected int | fQuotient(int temp, int low, int high) | protected int | findUTCSign(String buffer, int start, int end) | public short | getAllowedFacets() | protected int | getDate(String buffer, int start, int end, DateTimeData date) | protected Duration | getDuration(DateTimeData data) | protected void | getTime(String buffer, int start, int end, DateTimeData data) | protected void | getTimeZone(String buffer, DateTimeData data, int sign, int end) | protected XMLGregorianCalendar | getXMLGregorianCalendar(DateTimeData data) | protected int | getYearMonth(String buffer, int start, int end, DateTimeData date) | protected int | indexOf(String buffer, int start, int end, char ch) | public boolean | isIdentical(Object value1, Object value2) | final protected boolean | isNextCharUTCSign(String buffer, int start, int end) Returns true if the character at start is 'Z', '+' or '-'. | protected int | maxDayInMonthFor(int year, int month) | protected int | mod(int a, int b, int quotient) | protected int | modulo(int temp, int low, int high) | protected void | normalize(DateTimeData date) | protected int | parseInt(String buffer, int start, int end) | protected int | parseIntYear(String buffer, int end) | protected double | parseSecond(String buffer, int start, int end) | protected void | parseTimeZone(String buffer, int start, int end, DateTimeData date) Shared code from Date and YearMonth datatypes. | protected void | resetDateObj(DateTimeData data) | protected void | saveUnnormalized(DateTimeData date) | protected void | validateDateTime(DateTimeData data) |
DAY | final protected static int DAY(Code) | | |
MONTH | final protected static int MONTH(Code) | | |
YEAR | final protected static int YEAR(Code) | | |
compareDates | protected short compareDates(DateTimeData date1, DateTimeData date2, boolean strict)(Code) | | Compare algorithm described in dateDime (3.2.7).
Duration datatype overwrites this method
Parameters: date1 - normalized date representation of the first value Parameters: date2 - normalized date representation of the second value Parameters: strict - less, greater, less_equal, greater_equal, equal |
compareOrder | protected short compareOrder(DateTimeData date1, DateTimeData date2)(Code) | | Given normalized values, determines order-relation
between give date/time objects.
Parameters: date1 - date/time object Parameters: date2 - date/time object 0 if date1 and date2 are equal, a value less than 0 if date1 is less than date2, a value greater than 0 if date1 is greater than date2 |
dateToString | protected String dateToString(DateTimeData date)(Code) | | |
fQuotient | protected int fQuotient(int a, int b)(Code) | | |
fQuotient | protected int fQuotient(int temp, int low, int high)(Code) | | |
findUTCSign | protected int findUTCSign(String buffer, int start, int end)(Code) | | Return index of UTC char: 'Z', '+', '-'
Parameters: start - Parameters: end - index of the UTC character that was found |
getAllowedFacets | public short getAllowedFacets()(Code) | | |
getDate | protected int getDate(String buffer, int start, int end, DateTimeData date) throws RuntimeException(Code) | | Parses date CCYY-MM-DD
Parameters: buffer - Parameters: start - start position Parameters: end - end position Parameters: date - exception: RuntimeException - |
getTime | protected void getTime(String buffer, int start, int end, DateTimeData data) throws RuntimeException(Code) | | Parses time hh:mm:ss.sss and time zone if any
Parameters: start - Parameters: end - Parameters: data - exception: RuntimeException - |
getTimeZone | protected void getTimeZone(String buffer, DateTimeData data, int sign, int end) throws RuntimeException(Code) | | Parses time zone: 'Z' or {+,-} followed by hh:mm
Parameters: data - Parameters: sign - exception: RuntimeException - |
getYearMonth | protected int getYearMonth(String buffer, int start, int end, DateTimeData date) throws RuntimeException(Code) | | Parses date CCYY-MM
Parameters: buffer - Parameters: start - start position Parameters: end - end position Parameters: date - exception: RuntimeException - |
indexOf | protected int indexOf(String buffer, int start, int end, char ch)(Code) | | Computes index of given char within StringBuffer
Parameters: start - Parameters: end - Parameters: ch - character to look for in StringBuffer index of ch within StringBuffer |
isNextCharUTCSign | final protected boolean isNextCharUTCSign(String buffer, int start, int end)(Code) | | Returns true if the character at start is 'Z', '+' or '-'.
|
maxDayInMonthFor | protected int maxDayInMonthFor(int year, int month)(Code) | | Given {year,month} computes maximum
number of days for given month
Parameters: year - Parameters: month - integer containg the number of days in a given month |
mod | protected int mod(int a, int b, int quotient)(Code) | | |
modulo | protected int modulo(int temp, int low, int high)(Code) | | |
normalize | protected void normalize(DateTimeData date)(Code) | | If timezone present - normalize dateTime [E Adding durations to dateTimes]
Parameters: date - CCYY-MM-DDThh:mm:ss+03 |
parseInt | protected int parseInt(String buffer, int start, int end) throws NumberFormatException(Code) | | Given start and end position, parses string value
Parameters: buffer - string to parse Parameters: start - start position Parameters: end - end position return integer representation of characters |
parseIntYear | protected int parseIntYear(String buffer, int end)(Code) | | |
parseTimeZone | protected void parseTimeZone(String buffer, int start, int end, DateTimeData date) throws RuntimeException(Code) | | Shared code from Date and YearMonth datatypes.
Finds if time zone sign is present
Parameters: end - Parameters: date - exception: RuntimeException - |
resetDateObj | protected void resetDateObj(DateTimeData data)(Code) | | Resets object representation of date/time
Parameters: data - date/time object |
saveUnnormalized | protected void saveUnnormalized(DateTimeData date)(Code) | | Parameters: date - |
validateDateTime | protected void validateDateTime(DateTimeData data)(Code) | | Validates given date/time object accoring to W3C PR Schema
[D.1 ISO 8601 Conventions]
Parameters: data - |
|
|