Ejemplo n.º 1
0
 /**
  * This method closes the currently open/added element in order to do some internal housecleaning.
  *
  * @param name Name of the element being closed
  */
 public void closeElement(String name) {
   DataObject tmp = new DataObject();
   if (currentObject.parent != null) {
     tmp.parent = currentObject.parent.parent;
   } else {
     tmp.parent = null;
   }
   currentObject = tmp;
 }
Ejemplo n.º 2
0
 /**
  * This method adds an element to this DataObject
  *
  * @param name Name of an element
  */
 public void addElement(String name) {
   currentObject.name = name;
   DataObject tmp = new DataObject();
   tmp.parent = currentObject;
   if (currentObject.parent != null) {
     currentObject.parent.getValue().addElement(currentObject);
   }
   currentObject = tmp;
 }
Ejemplo n.º 3
0
  /**
   * This method adds an element and list of attributes to this DataObject. So far this was only
   * used by SAX_XMLDecoder
   *
   * @param name Name of an element
   * @param atts Map list of attributes; actually not being used anymore (deprecated)
   */
  public void addElement(String name, Map<String, String> atts) {
    currentObject.name = name;

    DataObject newObject = new DataObject();
    newObject.parent = currentObject; // new object is a child of the current
    if (currentObject.parent != null) {
      //			currentObject.parent.getValue().addElement(currentObject);
      currentObject.parent.children.add(currentObject);
    }
    currentObject = newObject;
  }
Ejemplo n.º 4
0
 /**
  * This method adds an element and list of attributes to this DataObject
  *
  * @param name Name of an element
  * @param atts Hashtable list of attributes
  */
 public void addElement(String name, Hashtable atts) {
   if (atts.size() != 0) {
     currentObject.attributes = atts;
   }
   currentObject.name = name;
   DataObject tmp = new DataObject();
   tmp.parent = currentObject;
   if (currentObject.parent != null) {
     currentObject.parent.getValue().addElement(currentObject);
   }
   currentObject = tmp;
 }
Ejemplo n.º 5
0
 /** Basic constructor. Sets up necessary internal variables. */
 public DataObject() {
   currentObject = this;
   currentObject.parent = null;
   this.value = new Vector();
 }
Ejemplo n.º 6
0
 /** Basic constructor. Sets up necessary internal variables. */
 public DataObject() {
   currentObject = this;
   currentObject.parent = null;
 }