Exemple #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;
 }
Exemple #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;
 }
Exemple #3
0
 public Node getChild(String type, String value) {
   for (Node child : getChildrenByType(type)) {
     if (value.equals(child.getValue())) return child;
   }
   return null;
 }
Exemple #4
0
 public boolean containsChild(String type, boolean value) {
   Node child = getChildByType(type);
   return child == null ? false : child.isValue(String.valueOf(value));
 }
Exemple #5
0
 public Node getSuperparentByType(String type) {
   if (parent == null) return null;
   if (parent.isType(type)) return parent;
   return parent.getSuperparentByType(type);
 }
Exemple #6
0
 public String getParentId() {
   return parent == null ? null : parent.getId();
 }
Exemple #7
0
 public boolean containsChildByTypeAndValueFalse(String type) {
   Node child = getChildByType(type);
   if (child == null) return false;
   return child.isValueFalse();
 }
Exemple #8
0
 public Node getChildByType(String type) {
   for (Node child : getChildren()) {
     if (child.isType(type)) return child;
   }
   return null;
 }
Exemple #9
0
 public String getChildValueByType(String type) {
   Node child = getChildByType(type);
   return child == null ? null : child.getValue();
 }