summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/DefaultHandler.java
blob: 4720f6781b4ded07e337c70e491b813b650667f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.madore.damlengine;

import java.util.Vector;
import java.util.HashMap;
import org.w3c.dom.*;

public class DefaultHandler {

    private DefaultHandler() { }

    public static void handle(TodoItem that) {
	System.err.println("handling a "+that.node.getNodeName()+" node");
	NodeList children = that.node.getChildNodes();
	Node child;
	Vector<TodoItem> toProcess = new Vector<TodoItem>();
	for ( int i=0 ; (child=children.item(i)) != null ; i++ ) {
	    if ( child.getNodeType() == Node.ELEMENT_NODE ) {
		TodoItem it = new TodoItem(child, that.context,
					   new HashMap<String,Object>());
		toProcess.add(it);
	    }
	}
	TodoDeque.registerAtStart(toProcess);
    }

}