|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.conversation.base.XmlParsingUtils
Class XmlParsingUtils provides a few convenience functions used in parsing XML files.
These functions are used by CpXmlParser
, but they're
split out into their own class
because they can be applied to general XML documents, not just cpXML docs, and to simplify
the already-bloated CpXmlParser class.
Method Summary | |
---|---|
static java.lang.String |
getLeafText(org.w3c.dom.Element element)
Returns the text inside a leaf element. |
static void |
main(java.lang.String[] args)
Runs a sequence of unit tests on the functions defined in this class. |
static long |
millisFromDuration(java.lang.String durationString)
Converts an xs:duration string to milliseconds, using the current System Date as starting Date. |
static long |
millisFromDuration(java.lang.String durationString,
java.util.Date startDate)
Converts an xs:duration string to milliseconds, as measured from the
given Date. |
static void |
testMillisFromDuration(java.lang.String durString)
Runs a unit test of the millisFromDuration() function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String getLeafText(org.w3c.dom.Element element)
This method assumes that the arg is indeed a leaf (i.e., there are no other elements inside it) and that there is indeed text inside it.
element
- The leaf element.public static long millisFromDuration(java.lang.String durationString)
The starting Date makes a difference only when the duration string specifies some number of years and/or months, since the number of days per month is not constant.
durationString
- The xs:duration string.public static long millisFromDuration(java.lang.String durationString, java.util.Date startDate)
xs:duration
string to milliseconds, as measured from the
given Date.
The starting Date makes a difference only when the duration string specifies some number of years and/or months, since the number of days per month is not constant.
durationString
- The xs:duration
string.startDate
- The Date to use as starting Date.public static void main(java.lang.String[] args)
args
- The command-line args. Not used.public static void testMillisFromDuration(java.lang.String durString)
millisFromDuration()
function.
Calculates the milliseconds and prints both duration string and milliseconds on standard output.
durString
- The duration string to convert to milliseconds.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |