public abstract class AbstractDateTimeDV extends TypeValidator
Modifier and Type | Field and Description |
---|---|
protected static javax.xml.datatype.DatatypeFactory |
datatypeFactory |
protected static int |
DAY |
protected static int |
MONTH |
protected static int |
YEAR |
EQUAL, GREATER_THAN, INDETERMINATE, LESS_THAN
Constructor and Description |
---|
AbstractDateTimeDV() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(java.lang.StringBuffer message,
double value) |
protected void |
append(java.lang.StringBuffer message,
int value,
int nch) |
protected void |
append2(java.lang.StringBuffer message,
double value) |
int |
compare(java.lang.Object value1,
java.lang.Object value2) |
protected short |
compareDates(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date1,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date2,
boolean strict)
Compare algorithm described in dateDime (3.2.7).
|
protected short |
compareOrder(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date1,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date2)
Given normalized values, determines order-relation
between give date/time objects.
|
protected java.lang.String |
dateToString(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date) |
protected int |
findUTCSign(java.lang.String buffer,
int start,
int end)
Return index of UTC char: 'Z', '+', '-'
|
protected int |
fQuotient(int a,
int b) |
protected int |
fQuotient(int temp,
int low,
int high) |
short |
getAllowedFacets() |
protected int |
getDate(java.lang.String buffer,
int start,
int end,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
Parses date CCYY-MM-DD
|
protected javax.xml.datatype.Duration |
getDuration(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data) |
protected java.math.BigDecimal |
getFractionalSecondsAsBigDecimal(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data) |
protected void |
getTime(java.lang.String buffer,
int start,
int end,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
Parses time hh:mm:ss.sss and time zone if any
|
protected void |
getTimeZone(java.lang.String buffer,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data,
int sign,
int end)
Parses time zone: 'Z' or {+,-} followed by hh:mm
|
protected javax.xml.datatype.XMLGregorianCalendar |
getXMLGregorianCalendar(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data) |
protected int |
getYearMonth(java.lang.String buffer,
int start,
int end,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
Parses date CCYY-MM
|
protected int |
indexOf(java.lang.String buffer,
int start,
int end,
char ch)
Computes index of given char within StringBuffer
|
boolean |
isIdentical(java.lang.Object value1,
java.lang.Object value2) |
protected boolean |
isNextCharUTCSign(java.lang.String buffer,
int start,
int end)
Returns
true if the character at start is 'Z', '+' or '-'. |
protected int |
maxDayInMonthFor(int year,
int month)
Given {year,month} computes maximum
number of days for given month
|
protected int |
mod(int a,
int b,
int quotient) |
protected int |
modulo(int temp,
int low,
int high) |
protected void |
normalize(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
If timezone present - normalize dateTime [E Adding durations to dateTimes]
|
protected int |
parseInt(java.lang.String buffer,
int start,
int end)
Given start and end position, parses string value
|
protected int |
parseIntYear(java.lang.String buffer,
int end) |
protected double |
parseSecond(java.lang.String buffer,
int start,
int end) |
protected void |
parseTimeZone(java.lang.String buffer,
int start,
int end,
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
Shared code from Date and YearMonth datatypes.
|
protected void |
resetDateObj(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
Resets object representation of date/time
|
protected void |
saveUnnormalized(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date) |
protected void |
validateDateTime(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
Validates given date/time object accoring to W3C PR Schema
[D.1 ISO 8601 Conventions]
|
checkExtraRules, getActualValue, getDataLength, getDigit, getFractionDigits, getTotalDigits, isDigit
protected static final int YEAR
protected static final int MONTH
protected static final int DAY
protected static final javax.xml.datatype.DatatypeFactory datatypeFactory
public short getAllowedFacets()
getAllowedFacets
in class TypeValidator
public boolean isIdentical(java.lang.Object value1, java.lang.Object value2)
isIdentical
in class TypeValidator
public int compare(java.lang.Object value1, java.lang.Object value2)
compare
in class TypeValidator
protected short compareDates(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date1, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date2, boolean strict)
date1
- normalized date representation of the first valuedate2
- normalized date representation of the second valuestrict
- protected short compareOrder(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date1, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date2)
date1
- date/time objectdate2
- date/time objectprotected void getTime(java.lang.String buffer, int start, int end, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data) throws java.lang.RuntimeException
start
- end
- data
- java.lang.RuntimeException
protected int getDate(java.lang.String buffer, int start, int end, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date) throws java.lang.RuntimeException
buffer
- start
- start positionend
- end positiondate
- java.lang.RuntimeException
protected int getYearMonth(java.lang.String buffer, int start, int end, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date) throws java.lang.RuntimeException
buffer
- start
- start positionend
- end positiondate
- java.lang.RuntimeException
protected void parseTimeZone(java.lang.String buffer, int start, int end, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date) throws java.lang.RuntimeException
end
- date
- java.lang.RuntimeException
protected void getTimeZone(java.lang.String buffer, org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data, int sign, int end) throws java.lang.RuntimeException
data
- sign
- java.lang.RuntimeException
protected int indexOf(java.lang.String buffer, int start, int end, char ch)
start
- end
- ch
- character to look for in StringBufferprotected void validateDateTime(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
data
- protected int findUTCSign(java.lang.String buffer, int start, int end)
start
- end
- protected final boolean isNextCharUTCSign(java.lang.String buffer, int start, int end)
true
if the character at start is 'Z', '+' or '-'.protected int parseInt(java.lang.String buffer, int start, int end) throws java.lang.NumberFormatException
buffer
- string to parsestart
- start positionend
- end positionjava.lang.NumberFormatException
protected int parseIntYear(java.lang.String buffer, int end)
protected void normalize(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
date
- CCYY-MM-DDThh:mm:ss+03protected void saveUnnormalized(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
date
- protected void resetDateObj(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
data
- date/time objectprotected int maxDayInMonthFor(int year, int month)
year
- month
- protected int mod(int a, int b, int quotient)
protected int fQuotient(int a, int b)
protected int modulo(int temp, int low, int high)
protected int fQuotient(int temp, int low, int high)
protected java.lang.String dateToString(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData date)
protected final void append(java.lang.StringBuffer message, int value, int nch)
protected final void append(java.lang.StringBuffer message, double value)
protected final void append2(java.lang.StringBuffer message, double value)
protected double parseSecond(java.lang.String buffer, int start, int end) throws java.lang.NumberFormatException
java.lang.NumberFormatException
protected javax.xml.datatype.XMLGregorianCalendar getXMLGregorianCalendar(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
protected javax.xml.datatype.Duration getDuration(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
protected final java.math.BigDecimal getFractionalSecondsAsBigDecimal(org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData data)
Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.