aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xml
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-27 02:02:59 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-27 02:02:59 +0100
commit4864f7200bbdb3e8d45eb7f165d62274f19e2e7b (patch)
tree54da6eeef9f9114dfb9e89c4342bdcee266414e2 /src/eu/siacs/conversations/xml
parentf4c9c19ec0f50fa7a80f4aa7dd28269335188f55 (diff)
fixed a couple of muc issues. added jingle listener (which doesn't do anything for now)
Diffstat (limited to 'src/eu/siacs/conversations/xml')
-rw-r--r--src/eu/siacs/conversations/xml/Element.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/xml/Element.java b/src/eu/siacs/conversations/xml/Element.java
index 91d9ed6b..2f1d7ad8 100644
--- a/src/eu/siacs/conversations/xml/Element.java
+++ b/src/eu/siacs/conversations/xml/Element.java
@@ -50,19 +50,34 @@ public class Element {
return null;
}
- public boolean hasChild(String name) {
+ public Element findChild(String name, String xmlns) {
for(Element child : this.children) {
- if (child.getName().equals(name)) {
- return true;
+ if (child.getName().equals(name)&&(child.getAttribute("xmlns").equals(xmlns))) {
+ return child;
}
}
- return false;
+ return null;
+ }
+
+ public boolean hasChild(String name) {
+ return findChild(name) != null;
+ }
+
+ public boolean hasChild(String name, String xmlns) {
+ return findChild(name, xmlns) != null;
}
+
+
public List<Element> getChildren() {
return this.children;
}
+ public Element setChildren(List<Element> children) {
+ this.children = children;
+ return this;
+ }
+
public String getContent() {
return content;
}
@@ -85,6 +100,10 @@ public class Element {
}
}
+ public Hashtable<String, String> getAttributes() {
+ return this.attributes;
+ }
+
public String toString() {
StringBuilder elementOutput = new StringBuilder();
if ((content==null)&&(children.size() == 0)) {