package org.madore.damlengine; import java.util.Map; import java.util.HashMap; import org.w3c.dom.Element; public class TodoElement extends TodoItem { protected static Map damlHandlers; protected static ElementHandler defaultHandler; { damlHandlers = new HashMap(); defaultHandler = new DefaultHandler(); } Element node; Map context; Map options; public TodoElement(Element node, Map context, Map options) { this.node = node; this.context = context; this.options = options; } public void dispatch() { ElementHandler handler; String nsuri = node.getNamespaceURI(); if ( nsuri != null && nsuri.equals(DamlEngine.DAML_NS) ) { handler = damlHandlers.get(node.getLocalName()); if ( handler == null ) handler = defaultHandler; } else handler = defaultHandler; handler.handle(this); } }