/** * 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; }
/** * 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; }
/** * 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; }