diff options
author | Glen Mazza <gmazza@apache.org> | 2003-07-12 21:22:04 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-07-12 21:22:04 +0000 |
commit | 0e6c2209be64649074f003d33d049c2420664248 (patch) | |
tree | cd969e91e5af4877ecb9a17c684b15ee84e3726c /examples | |
parent | e22802340b91f6c6eb2b9f81d168d59a3ae1c01c (diff) | |
download | xmlgraphics-fop-0e6c2209be64649074f003d33d049c2420664248.tar.gz xmlgraphics-fop-0e6c2209be64649074f003d33d049c2420664248.zip |
Reconfigured ElementMapping from an interface to an abstract base class
Removed FOTreeBuilder references from all ElementMapping subclasses
Simplified FOTreeBuilder ElementMapping instantiation somewhat
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196687 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples')
-rw-r--r-- | examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java | 20 | ||||
-rw-r--r-- | examples/plan/src/org/apache/fop/plan/PlanElementMapping.java | 20 |
2 files changed, 10 insertions, 30 deletions
diff --git a/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java b/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java index c80a0c33c..9c48520eb 100644 --- a/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java +++ b/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java @@ -50,7 +50,6 @@ */ package org.apache.fop.mathml; -import org.apache.fop.fo.FOTreeBuilder; import org.apache.fop.fo.FONode; import org.apache.fop.fo.ElementMapping; import org.apache.fop.image.analyser.XMLReader; @@ -65,14 +64,13 @@ import net.sourceforge.jeuclid.DOMMathBuilder; /** * This class provides the element mapping for FOP. */ -public class MathMLElementMapping implements ElementMapping { +public class MathMLElementMapping extends ElementMapping { - /** MathML namespace */ - public static final String URI = "http://www.w3.org/1998/Math/MathML"; - - private static HashMap foObjs = null; + public MathMLElementMapping() { + URI = "http://www.w3.org/1998/Math/MathML"; + } - private static synchronized void setupMathML() { + protected void initialize() { if (foObjs == null) { foObjs = new HashMap(); foObjs.put("math", new ME()); @@ -82,14 +80,6 @@ public class MathMLElementMapping implements ElementMapping { } } - /** - * @see org.apache.fop.fo.ElementMapping#addToBuilder(FOTreeBuilder) - */ - public void addToBuilder(FOTreeBuilder builder) { - setupMathML(); - builder.addMapping(URI, foObjs); - } - static class MathMLMaker extends ElementMapping.Maker { public FONode make(FONode parent) { return new MathMLObj(parent); diff --git a/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java b/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java index 7a1fecb19..724871edd 100644 --- a/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java +++ b/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java @@ -50,7 +50,6 @@ */ package org.apache.fop.plan; -import org.apache.fop.fo.FOTreeBuilder; import org.apache.fop.fo.FONode; import org.apache.fop.fo.ElementMapping; import org.apache.fop.image.analyser.XMLReader; @@ -62,14 +61,13 @@ import java.util.HashMap; /** * This class provides the element mapping for FOP. */ -public class PlanElementMapping implements ElementMapping { +public class PlanElementMapping extends ElementMapping { - /** The namespace for the plan extension */ - public static final String URI = "http://xml.apache.org/fop/plan"; - - private static HashMap foObjs = null; + public PlanElementMapping() { + URI = "http://xml.apache.org/fop/plan"; + } - private static synchronized void setupPlan() { + protected void initialize() { if (foObjs == null) { foObjs = new java.util.HashMap(); foObjs.put("plan", new PE()); @@ -79,14 +77,6 @@ public class PlanElementMapping implements ElementMapping { } } - /** - * @see org.apache.fop.fo.ElementMapping#addToBuilder(FOTreeBuilder) - */ - public void addToBuilder(FOTreeBuilder builder) { - setupPlan(); - builder.addMapping(URI, foObjs); - } - static class PlanMaker extends ElementMapping.Maker { public FONode make(FONode parent) { return new PlanObj(parent); |