public class WSUtils extends Object
Constructor and Description |
---|
WSUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
formatDate(Date date)
Formats a date into yyyy-MM-dd'T'HH:mm:ss.SSSZ, for example 2008-02-13T18:54:29.147-03:00
|
protected static String |
getElementText(org.dom4j.Node node,
String name)
Returns the text of the first an element with name 'name'.
|
protected static String |
getReturn(org.dom4j.Element element)
Returns the text of the first an element with name 'return'.
|
protected static String |
marshallList(List<String> data) |
protected static void |
modifyElementText(org.dom4j.Element element,
String[] path,
String newValue) |
protected static void |
modifyElementText(org.dom4j.Node node,
String name,
String newValue)
Modifies the text of the elmement with name 'name'.
|
static Date |
parseDate(String date)
Parses a date of the form 1969-12-31T21:00:00-03:00, or 2008-02-13T18:54:29.147-03:00.
|
protected static List<String> |
parseStringArray(org.dom4j.Element element)
Parse REST responses of the type String[], that are XML of the form:
|
protected static List<String> |
parseUsernameArray(org.dom4j.Element element)
Parse REST responses of the type String[] that represent usernames, that are XML of the form:
|
protected static String getReturn(org.dom4j.Element element)
element
- the element to search for a return element.protected static String getElementText(org.dom4j.Node node, String name)
node
- the element to search for a "name" element.name
- the name of the element to searchprotected static void modifyElementText(org.dom4j.Node node, String name, String newValue)
node
- the element to searchname
- the name to searchnewValue
- the new value of the textprotected static void modifyElementText(org.dom4j.Element element, String[] path, String newValue)
protected static List<String> parseStringArray(org.dom4j.Element element)
<something>
<return>text1</return>
<return>text2</return>
<return>text3</return>
</something>
element
- Element from REST response to be parsed.protected static List<String> parseUsernameArray(org.dom4j.Element element)
<something>
<return>text1</return>
<return>text2</return>
<return>text3</return>
</something>
element
- Element from REST response to be parsed.public static Date parseDate(String date)
date
- the string to parseCopyright © 2003-2008 Jive Software.