From 6cba05247ae4e6c202c4c126a535b17526f71127 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sat, 17 Apr 2010 04:33:42 +0200 Subject: Use factories implemented as nested classes (rather than reflected constructors) to store classes to instantiate. Now every subclass of TodoElement or TodoAttr should also come with a nested subclass of TodoElement.Factory or TodoAttr.Factory which just contains a(n instance) method to call its constructor. In essecne, the factory instance is just used as a pointer to the class to create (or its constructor, as in the previous version). --- org/madore/damlengine/TodoXemptyAttr.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'org/madore/damlengine/TodoXemptyAttr.java') diff --git a/org/madore/damlengine/TodoXemptyAttr.java b/org/madore/damlengine/TodoXemptyAttr.java index e2cbe61..7eaf636 100644 --- a/org/madore/damlengine/TodoXemptyAttr.java +++ b/org/madore/damlengine/TodoXemptyAttr.java @@ -5,6 +5,14 @@ import org.w3c.dom.*; public class TodoXemptyAttr extends TodoAttr { + public static class Factory extends TodoAttr.Factory { + public TodoXemptyAttr newItem(Attr attr, Element owner, + Map context, + Map options) { + return new TodoXemptyAttr(attr, owner, context, options); + } + } + public TodoXemptyAttr(Attr attr, Element owner, Map context, Map options) { super(attr, owner, context, options); -- cgit v1.2.3