|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deckfour.xes.util.XsDateTimeConversion
public class XsDateTimeConversion
This class serves as a provider for static xs:dateTime-related manipulation and parsing methods. Note that this class should not be static, as access to SimpleDateFormat needs to be synchronized and hence multiple threads would be holding onto each other.
Field Summary | |
---|---|
protected GregorianCalendar |
cal
Calendar instance used for calculating dates for timestamps |
protected SimpleDateFormat |
dfMillisTZone
Date/Time parsing instance with milliseconds and time zone information. |
protected static String |
XSDATETIME_FORMAT_STRING_MILLIS_TZONE
Date/Time parsing format including milliseconds and time zone information. |
protected Pattern |
xsDtPattern
Pattern used for matching the XsDateTime formatted timestamp strings. |
Constructor Summary | |
---|---|
XsDateTimeConversion()
|
Method Summary | |
---|---|
String |
format(Date date)
Formats a given date to the xs:dateTime format of XML. |
Date |
parseXsDateTime(String xsDateTime)
Expects an XML xs:dateTime lexical format string, as in 2005-10-24T11:57:31.000+01:00 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String XSDATETIME_FORMAT_STRING_MILLIS_TZONE
protected final SimpleDateFormat dfMillisTZone
protected final Pattern xsDtPattern
protected GregorianCalendar cal
Constructor Detail |
---|
public XsDateTimeConversion()
Method Detail |
---|
public Date parseXsDateTime(String xsDateTime)
2005-10-24T11:57:31.000+01:00
. Some bad MXML files miss
timezone or milliseconds information, thus a certain amount of tolerance
is applied towards malformed timestamp string representations. If
unparseable, this method will return null
.
xsDateTime
- Timestamp string in the XML xs:dateTime format.
public String format(Date date)
date
- Date to be formatted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |