aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/svg/SVGElementMapping.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-12-13 09:40:04 +0000
committerKeiron Liddle <keiron@apache.org>2001-12-13 09:40:04 +0000
commit0c1075bfe6de132c82ae58d1e8370f777c4995ef (patch)
tree4c3df4fecbd795326d895fe7c4af48b9bd0be825 /src/org/apache/fop/svg/SVGElementMapping.java
parent08a0cfd14dc86ad6c856821ee3cceb40d23b97ea (diff)
downloadxmlgraphics-fop-0c1075bfe6de132c82ae58d1e8370f777c4995ef.tar.gz
xmlgraphics-fop-0c1075bfe6de132c82ae58d1e8370f777c4995ef.zip
properly setup the element mappings
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194604 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/svg/SVGElementMapping.java')
-rw-r--r--src/org/apache/fop/svg/SVGElementMapping.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/org/apache/fop/svg/SVGElementMapping.java b/src/org/apache/fop/svg/SVGElementMapping.java
index a4db558e0..c4e4a19c0 100644
--- a/src/org/apache/fop/svg/SVGElementMapping.java
+++ b/src/org/apache/fop/svg/SVGElementMapping.java
@@ -21,20 +21,23 @@ public class SVGElementMapping implements ElementMapping {
private static HashMap foObjs = null;
- public synchronized void addToBuilder(FOTreeBuilder builder) {
- try {
- if (foObjs == null) {
- // this sets the parser that will be used
- // by default (SVGBrokenLinkProvider)
- // normally the user agent value is used
- XMLResourceDescriptor.setXMLParserClassName(
- Driver.getParserClassName());
-
- foObjs = new HashMap();
- foObjs.put("svg", new SE());
- foObjs.put(DEFAULT, new SVGMaker());
- }
+ private static synchronized void setupSVG() {
+ if (foObjs == null) {
+ // this sets the parser that will be used
+ // by default (SVGBrokenLinkProvider)
+ // normally the user agent value is used
+ XMLResourceDescriptor.setXMLParserClassName(
+ Driver.getParserClassName());
+
+ foObjs = new HashMap();
+ foObjs.put("svg", new SE());
+ foObjs.put(DEFAULT, new SVGMaker());
+ }
+ }
+ public void addToBuilder(FOTreeBuilder builder) {
+ try {
+ setupSVG();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
builder.addMapping(svgNS, foObjs);
} catch (Throwable t) {
@@ -42,13 +45,13 @@ public class SVGElementMapping implements ElementMapping {
}
}
- class SVGMaker extends ElementMapping.Maker {
+ static class SVGMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new SVGObj(parent);
}
}
- class SE extends ElementMapping.Maker {
+ static class SE extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new SVGElement(parent);
}