Beispiel #1
0
 public List<Node> getChildrenByType(String type) {
   List<Node> ret = new ArrayList<Node>();
   for (Node child : getChildren()) {
     if (child.isType(type)) ret.add(child);
   }
   return ret;
 }
Beispiel #2
0
 public Node getChildRecursive(String type, String value) {
   for (Node child : getChildrenByType(type)) {
     if (value.equals(child.getValue())) return child;
   }
   for (Node child : getChildren()) {
     Node ret = child.getChildRecursive(type, value);
     if (ret != null) return ret;
   }
   return null;
 }
Beispiel #3
0
 public Node getChild(String type, String value) {
   for (Node child : getChildrenByType(type)) {
     if (value.equals(child.getValue())) return child;
   }
   return null;
 }
Beispiel #4
0
 public boolean containsChild(String type, boolean value) {
   Node child = getChildByType(type);
   return child == null ? false : child.isValue(String.valueOf(value));
 }
Beispiel #5
0
 public Node getSuperparentByType(String type) {
   if (parent == null) return null;
   if (parent.isType(type)) return parent;
   return parent.getSuperparentByType(type);
 }
Beispiel #6
0
 public String getParentId() {
   return parent == null ? null : parent.getId();
 }
Beispiel #7
0
 public boolean containsChildByTypeAndValueFalse(String type) {
   Node child = getChildByType(type);
   if (child == null) return false;
   return child.isValueFalse();
 }
Beispiel #8
0
 public Node getChildByType(String type) {
   for (Node child : getChildren()) {
     if (child.isType(type)) return child;
   }
   return null;
 }
Beispiel #9
0
 public String getChildValueByType(String type) {
   Node child = getChildByType(type);
   return child == null ? null : child.getValue();
 }