com.thaiopensource.datatype.xsd
Class DateTimeDatatype
java.lang.Object
com.thaiopensource.datatype.xsd.DatatypeBase
com.thaiopensource.datatype.xsd.TokenDatatype
com.thaiopensource.datatype.xsd.RegexDatatype
com.thaiopensource.datatype.xsd.DateTimeDatatype
- All Implemented Interfaces:
- Datatype2, Measure, OrderRelation, Datatype
class DateTimeDatatype
- extends RegexDatatype
- implements OrderRelation
Constructor Summary |
DateTimeDatatype(String template)
The argument specifies the lexical representation accepted:
Y specifies a year with optional preceding minus
M specifies a two digit month
D specifies a two digit day of month
t specifies a time (hh:mm:ss.sss)
any other character stands for itself. |
Method Summary |
(package private) boolean |
allowsValue(String str,
ValidationContext vc)
|
private static void |
checkDate(boolean isLeapYear,
int month,
int day)
|
private static Date |
createDate(GregorianCalendar cal,
int tzOffset,
boolean negative,
int year,
int month,
int day,
int hours,
int minutes,
int seconds,
int milliseconds)
|
(package private) OrderRelation |
getOrderRelation()
|
(package private) Object |
getValue(String str,
ValidationContext vc)
|
private static boolean |
isLessThan(long t1,
int leapMillis1,
long t2,
int leapMillis2)
|
boolean |
isLessThan(Object obj1,
Object obj2)
|
private static String |
makePattern(String template)
|
private static int |
parse2Digits(String str,
int i)
|
private static int |
parseTimeZone(String str,
int i)
|
private static int |
skipDigits(String str,
int i)
|
Methods inherited from class com.thaiopensource.datatype.xsd.DatatypeBase |
checkValid, createStreamingValidator, createValue, getIdType, getPrimitive, getWhiteSpace, isContextDependent, isValid, normalizeWhiteSpace, sameValue, valueHashCode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
YEAR_PATTERN
private static final String YEAR_PATTERN
- See Also:
- Constant Field Values
MONTH_PATTERN
private static final String MONTH_PATTERN
- See Also:
- Constant Field Values
DAY_OF_MONTH_PATTERN
private static final String DAY_OF_MONTH_PATTERN
- See Also:
- Constant Field Values
TIME_PATTERN
private static final String TIME_PATTERN
- See Also:
- Constant Field Values
TZ_PATTERN
private static final String TZ_PATTERN
- See Also:
- Constant Field Values
template
private final String template
TIME_ZONE_MAX
private static final int TIME_ZONE_MAX
- See Also:
- Constant Field Values
DateTimeDatatype
DateTimeDatatype(String template)
- The argument specifies the lexical representation accepted:
Y specifies a year with optional preceding minus
M specifies a two digit month
D specifies a two digit day of month
t specifies a time (hh:mm:ss.sss)
any other character stands for itself.
All lexical representations are implicitly followed by an optional time zone.
makePattern
private static String makePattern(String template)
allowsValue
boolean allowsValue(String str,
ValidationContext vc)
- Overrides:
allowsValue
in class DatatypeBase
getValue
Object getValue(String str,
ValidationContext vc)
- Overrides:
getValue
in class TokenDatatype
createDate
private static Date createDate(GregorianCalendar cal,
int tzOffset,
boolean negative,
int year,
int month,
int day,
int hours,
int minutes,
int seconds,
int milliseconds)
checkDate
private static void checkDate(boolean isLeapYear,
int month,
int day)
parseTimeZone
private static int parseTimeZone(String str,
int i)
parse2Digits
private static int parse2Digits(String str,
int i)
skipDigits
private static int skipDigits(String str,
int i)
getOrderRelation
OrderRelation getOrderRelation()
- Overrides:
getOrderRelation
in class DatatypeBase
isLessThan
public boolean isLessThan(Object obj1,
Object obj2)
- Specified by:
isLessThan
in interface OrderRelation
isLessThan
private static boolean isLessThan(long t1,
int leapMillis1,
long t2,
int leapMillis2)