From c18d6e561179a3a96d93a9ae8c6034115ba36923 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Thu, 15 Apr 2010 23:06:03 +0200 Subject: Change dispatching approach: handlers are now part of todoItems. Instead of dispatching the todo item in function of the DAML node's local name at todo-handling time, the appropriate todo handler subclass is now instantiated in the todo deque by dispatching the creation of the todo item to the appropriate constructor. --- org/madore/damlengine/ElementHandler.java | 42 ------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 org/madore/damlengine/ElementHandler.java (limited to 'org/madore/damlengine/ElementHandler.java') diff --git a/org/madore/damlengine/ElementHandler.java b/org/madore/damlengine/ElementHandler.java deleted file mode 100644 index 59981ac..0000000 --- a/org/madore/damlengine/ElementHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.madore.damlengine; - -import java.util.Vector; -import java.util.HashMap; -import org.w3c.dom.*; - -public abstract class ElementHandler { - - public void handleAttributes(TodoElement that) { - NamedNodeMap attrs = that.node.getAttributes(); - Node attr; - Vector toProcess = new Vector(); - for ( int i=0 ; (attr=attrs.item(i)) != null ; i++ ) { - TodoAttr it = new TodoAttr((Attr)attr, that.node, that.context, - new HashMap()); - toProcess.add(it); - } - that.ownerDeque.registerAtStart(toProcess); - } - - public void handleNodeOnly(TodoElement that) { - System.err.println("handling a "+that.node.getNodeName()+" element"); - NodeList children = that.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 = new TodoElement((Element)child, that.context, - new HashMap()); - toProcess.add(it); - } - } - that.ownerDeque.registerAtStart(toProcess); - } - - public void handle(TodoElement that) { - assert(that.ownerDeque != null); - handleAttributes(that); - handleNodeOnly(that); - } - -} -- cgit v1.2.3