From 8b2d4cc55eba7b1431a861beaf8181d0052b76bf Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Mon, 19 Apr 2010 09:48:21 +0200 Subject: Rather than an ad hoc "Options" class, use caller todo directly. --- org/madore/damlengine/TodoDamlElement.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'org/madore/damlengine/TodoDamlElement.java') diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java index d177998..419e7d3 100644 --- a/org/madore/damlengine/TodoDamlElement.java +++ b/org/madore/damlengine/TodoDamlElement.java @@ -9,22 +9,19 @@ public class TodoDamlElement extends TodoDefaultElement { public static class Factory extends TodoElement.Factory { public TodoDamlElement newItem(Element node, Context ctx, - TodoItem.Options options) { - return new TodoDamlElement(node, ctx, options); + TodoItem caller) { + return new TodoDamlElement(node, ctx, caller); } } public TodoDamlElement(Element node, Context ctx, - TodoItem.Options options) { - super(node, ctx, options); - } - - public static class DamlOptions extends TodoItem.Options { + TodoItem caller) { + super(node, ctx, caller); } public void handleNodeOnly() { - if ( ! ( options instanceof DamlEngine.RootOptions ) ) + if ( ! ( caller instanceof DamlEngine.RootTodo ) ) throw new IllegalArgumentException("daml node can only be root node"); final String uriToTopName = "uri-to-top"; if ( node.hasAttributeNS(null, uriToTopName) ) @@ -86,8 +83,7 @@ public class TodoDamlElement extends TodoDefaultElement { ctx.headNode.appendChild(ctx.doc.createTextNode("\n")); } TodoElement it - = TodoElement.getTodoElement((Element)child, this.ctx, - new DamlOptions()); + = TodoElement.getTodoElement((Element)child, this.ctx, this); toProcess.add(it); } else if ( child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE ) { @@ -98,10 +94,10 @@ public class TodoDamlElement extends TodoDefaultElement { this.ownerDeque.registerAtStart(toProcess); this.ownerDeque. registerAtEnd(new TodoStyleOrScript(TodoStyleOrScript.Type.STYLE, - this.ctx, new DamlOptions())); + this.ctx, this)); this.ownerDeque. registerAtEnd(new TodoStyleOrScript(TodoStyleOrScript.Type.SCRIPT, - this.ctx, new DamlOptions())); + this.ctx, this)); } } -- cgit v1.2.3