mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 20:52:21 -05:00
further bullet proofing
This commit is contained in:
parent
a92fb88e51
commit
899da61555
@ -52,7 +52,8 @@ public class Element {
|
|||||||
|
|
||||||
public Element findChild(String name, String xmlns) {
|
public Element findChild(String name, String xmlns) {
|
||||||
for (Element child : this.children) {
|
for (Element child : this.children) {
|
||||||
if (child.getName().equals(name)&&(child.getAttribute("xmlns").equals(xmlns))) {
|
if (child.getName().equals(name)
|
||||||
|
&& (child.getAttribute("xmlns").equals(xmlns))) {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,8 +68,6 @@ public class Element {
|
|||||||
return findChild(name, xmlns) != null;
|
return findChild(name, xmlns) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<Element> getChildren() {
|
public List<Element> getChildren() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
@ -83,7 +82,9 @@ public class Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Element setAttribute(String name, String value) {
|
public Element setAttribute(String name, String value) {
|
||||||
|
if (name != null && value != null) {
|
||||||
this.attributes.put(name, value);
|
this.attributes.put(name, value);
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user