aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/fo/extensions')
-rw-r--r--src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java15
-rw-r--r--src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java24
2 files changed, 31 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
index 7b34d6c01..0fce5b8dd 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,19 +24,29 @@ import javax.xml.parsers.SAXParserFactory;
import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.FONode;
+import org.w3c.dom.DOMImplementation;
/**
* This Element Mapping is for Batik SVG Extension elements
* of the http://xml.apache.org/batik/ext namespace.
*/
public class BatikExtensionElementMapping extends ElementMapping {
- public static String URI = "http://xml.apache.org/batik/ext";
+
+ /** Namespace URI for Batik extension elements */
+ public static final String URI = "http://xml.apache.org/batik/ext";
+
private boolean batikAvail = true;
+ /** Main constructor. */
public BatikExtensionElementMapping() {
namespaceURI = URI;
}
+ /** @see org.apache.fop.fo.ElementMapping#getDOMImplementation() */
+ public DOMImplementation getDOMImplementation() {
+ return null; //no DOMImplementation necessary here
+ }
+
/**
* Returns the fully qualified classname of an XML parser for
* Batik classes that apparently need it (error messages, perhaps)
@@ -83,4 +93,5 @@ public class BatikExtensionElementMapping extends ElementMapping {
return new SVGElement(parent);
}
}
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
index 6b477bf46..78fab53f8 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.apache.fop.fo.ElementMapping;
import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.w3c.dom.DOMImplementation;
/**
* Setup the SVG element mapping.
@@ -33,19 +34,28 @@ import org.apache.batik.dom.svg.SVGDOMImplementation;
* that create the SVG Document.
*/
public class SVGElementMapping extends ElementMapping {
- public static String URI = SVGDOMImplementation.SVG_NAMESPACE_URI;
- private boolean batik = true;
+
+ /** the SVG namespace */
+ public static final String URI = SVGDOMImplementation.SVG_NAMESPACE_URI;
+
+ private boolean batikAvailable = true;
+ /** Main constructor. */
public SVGElementMapping() {
namespaceURI = URI;
}
+ /** @see org.apache.fop.fo.ElementMapping#getDOMImplementation() */
+ public DOMImplementation getDOMImplementation() {
+ return SVGDOMImplementation.getDOMImplementation();
+ }
+
/**
* Returns the fully qualified classname of an XML parser for
* Batik classes that apparently need it (error messages, perhaps)
* @return an XML parser classname
*/
- private final String getAParserClassName() {
+ private String getAParserClassName() {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
return factory.newSAXParser().getXMLReader().getClass().getName();
@@ -54,8 +64,9 @@ public class SVGElementMapping extends ElementMapping {
}
}
+ /** @see org.apache.fop.fo.ElementMapping#initialize() */
protected void initialize() {
- if (foObjs == null && batik == true) {
+ if (foObjs == null && batikAvailable) {
// this sets the parser that will be used
// by default (SVGBrokenLinkProvider)
// normally the user agent value is used
@@ -69,7 +80,7 @@ public class SVGElementMapping extends ElementMapping {
} catch (Throwable t) {
// if the classes are not available
// the DISPLAY is not checked
- batik = false;
+ batikAvailable = false;
}
}
}
@@ -85,4 +96,5 @@ public class SVGElementMapping extends ElementMapping {
return new SVGElement(parent);
}
}
+
}