package org.madore.damlengine; import java.util.Map; import java.util.HashMap; import java.util.Vector; import org.w3c.dom.*; public class TodoDefaultElement extends TodoElement { public TodoDefaultElement(Element node, Map context, Map options) { super(node,context,options); } public void handleAttributes() { NamedNodeMap attrs = this.node.getAttributes(); Node attr; Vector toProcess = new Vector(); for ( int i=0 ; (attr=attrs.item(i)) != null ; i++ ) { TodoAttr it = TodoAttr.getTodoAttr((Attr)attr, this.node, this.context, new HashMap()); if ( it != null ) toProcess.add(it); } this.ownerDeque.registerAtStart(toProcess); } public void handleNodeOnly() { System.err.println("handling a "+this.node.getNodeName()+" element"); NodeList children = this.node.getChildNodes(); Node child; Vector toProcess = new Vector(); for ( int i=0 ; (child=children.item(i)) != null ; i++ ) { if ( child.getNodeType() == Node.ELEMENT_NODE ) { TodoElement it = TodoElement.getTodoElement((Element)child, this.context, new HashMap()); toProcess.add(it); } } this.ownerDeque.registerAtStart(toProcess); } public void handle() { assert(this.ownerDeque != null); handleAttributes(); handleNodeOnly(); } }