Exemplo n.º 1
0
  /**
   * DOCUMENT ME!
   *
   * @return DOCUMENT ME!
   */
  public String getFullPath() {
    String result = "";
    NodeSource src = this;

    while ((src != null) && (src.getTagName() != null)) {
      result = "/" + src.getTagName() + result;
      src = src.parent;
    }

    return result;
  }
Exemplo n.º 2
0
  /**
   * DOCUMENT ME!
   *
   * @param tag DOCUMENT ME!
   * @return DOCUMENT ME!
   */
  public NodeSource getChildByTagName(String tag) {
    if (this.children != null) {
      Iterator it = this.children.iterator();

      while (it.hasNext()) {
        NodeSource result = (NodeSource) it.next();

        if (tag.equals(result.getTagName())) {
          return result;
        }
      }
    }

    return null;
  }
Exemplo n.º 3
0
  /**
   * DOCUMENT ME!
   *
   * @param tag DOCUMENT ME!
   * @return DOCUMENT ME!
   */
  public NodeSource getNodeSourceByTagName(String tag) {
    Iterator it = this.children.iterator();

    while (it.hasNext()) {
      NodeSource src = (NodeSource) it.next();

      if (tag.equals(src.getTagName())) {
        return src;
      } else {
        NodeSource result = src.getNodeSourceByTagName(tag);

        if (result != null) {
          return result;
        }
      }
    }

    return null;
  }