diff options
author | David A. Madore <david+git@madore.org> | 2011-08-26 16:53:03 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2011-08-26 16:53:03 +0200 |
commit | 961bdfc66151b9aef46149e4730110ef409e5587 (patch) | |
tree | 4b6ad9a0e8253905af8d8f838ef2668fec4bfc0e /org/madore/damlengine/Context.java | |
parent | 7d3f4db185f5499160228afb228ecac6c6d22476 (diff) | |
download | damlengine-961bdfc66151b9aef46149e4730110ef409e5587.tar.gz damlengine-961bdfc66151b9aef46149e4730110ef409e5587.tar.bz2 damlengine-961bdfc66151b9aef46149e4730110ef409e5587.zip |
Move most of the context to a "general context" substructure.
This is so as to make sure that cloning (which does a shallow copy)
gives us references to the same mutable content.
Diffstat (limited to 'org/madore/damlengine/Context.java')
-rw-r--r-- | org/madore/damlengine/Context.java | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/org/madore/damlengine/Context.java b/org/madore/damlengine/Context.java index 22912a7..f5d12bf 100644 --- a/org/madore/damlengine/Context.java +++ b/org/madore/damlengine/Context.java @@ -6,19 +6,24 @@ import org.w3c.dom.*; public class Context implements Cloneable { public final Document doc; - public Element htmlNode; - public Element headNode; - public String uriToTop; - public String fileName; - public StringBuffer styleContent; - public StringBuffer scriptContent; - public DocumentFragment title; - public String titleStr; - public String titleLang; - public DocumentFragment subtitle; - public String subtitleStr; - public String subtitleLang; - public ArrayList<String> translations; + + public static class GeneralContext { + public Element htmlNode; + public Element headNode; + public String uriToTop; + public String fileName; + public StringBuffer styleContent; + public StringBuffer scriptContent; + public DocumentFragment title; + public String titleStr; + public String titleLang; + public DocumentFragment subtitle; + public String subtitleStr; + public String subtitleLang; + public ArrayList<String> translations; + } + + public GeneralContext gc; public static class EntryContext { public String year; @@ -37,10 +42,11 @@ public class Context implements Cloneable { } } - public EntryContext entryCtx; + public EntryContext ent; public Context(Document doc) { this.doc = doc; + this.gc = new GeneralContext(); } public Context clone() { |