1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.tiptimes.util;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.jasig.cas.client.util.XmlUtils;
public class CASXmlUtils {
public CASXmlUtils() {
}
public static Map<String, Object> leadXML(String xml) throws DocumentException {
Map<String, Object> map = new HashMap();
Document document = DocumentHelper.parseText(xml);
Element serviceResponse_root = document.getRootElement();
listNodes(serviceResponse_root, map);
return map;
}
public static String leadlogoutXML(String xml) {
new HashMap();
if ("".equals(xml.trim())) {
return "";
} else {
String sessionIdentifier = XmlUtils.getTextForElement(xml, "SessionIndex");
return sessionIdentifier;
}
}
private static void listNodes(Element node, Map<String, Object> map) {
if (!node.getTextTrim().equals("")) {
map.put(node.getName(), node.getText().trim());
}
Iterator iterator = node.elementIterator();
while(iterator.hasNext()) {
Element e = (Element)iterator.next();
listNodes(e, map);
}
}
}