You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2006/02/14 10:11:31 UTC

svn commit: r377672 - in /xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop: apps/FopFactory.java area/AreaTreeParser.java util/ContentHandlerFactoryRegistry.java

Author: jeremias
Date: Tue Feb 14 01:11:27 2006
New Revision: 377672

URL: http://svn.apache.org/viewcvs?rev=377672&view=rev
Log:
Hooking the ContentHandlerFactoryRegistry into the FopFactor.

Modified:
    xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/apps/FopFactory.java
    xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/area/AreaTreeParser.java
    xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java

Modified: xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/apps/FopFactory.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/apps/FopFactory.java?rev=377672&r1=377671&r2=377672&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/apps/FopFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/apps/FopFactory.java Tue Feb 14 01:11:27 2006
@@ -34,6 +34,7 @@
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
 import org.apache.fop.render.RendererFactory;
 import org.apache.fop.render.XMLHandlerRegistry;
+import org.apache.fop.util.ContentHandlerFactoryRegistry;
 import org.xml.sax.SAXException;
 
 /**
@@ -61,6 +62,10 @@
     
     /** The registry for ElementMapping instances */
     private ElementMappingRegistry elementMappingRegistry;
+
+    /** The registry for ContentHandlerFactory instance */ 
+    private ContentHandlerFactoryRegistry contentHandlerFactoryRegistry 
+                = new ContentHandlerFactoryRegistry();
     
     /** user configuration */
     private Configuration userConfig = null;
@@ -178,6 +183,11 @@
     /** @return the element mapping registry */
     public ElementMappingRegistry getElementMappingRegistry() {
         return this.elementMappingRegistry;
+    }
+
+    /** @return the content handler factory registry */
+    public ContentHandlerFactoryRegistry getContentHandlerFactoryRegistry() {
+        return this.contentHandlerFactoryRegistry;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/area/AreaTreeParser.java?rev=377672&r1=377671&r2=377672&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/area/AreaTreeParser.java Tue Feb 14 01:11:27 2006
@@ -250,8 +250,9 @@
                         handled = false;
                     }
                 } else {
-                    ContentHandlerFactory factory 
-                            = ContentHandlerFactoryRegistry.getInstance().getFactory(uri);
+                    ContentHandlerFactoryRegistry registry
+                            = userAgent.getFactory().getContentHandlerFactoryRegistry();
+                    ContentHandlerFactory factory = registry.getFactory(uri);
                     if (factory != null) {
                         delegate = factory.createContentHandler();
                         delegateStack.push(qName);

Modified: xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java?rev=377672&r1=377671&r2=377672&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java (original)
+++ xmlgraphics/fop/branches/Temp_API_Finalization/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java Tue Feb 14 01:11:27 2006
@@ -36,20 +36,8 @@
     /** the logger */
     private static Log log = LogFactory.getLog(ContentHandlerFactoryRegistry.class);
     
-    private static ContentHandlerFactoryRegistry instance;
-    
     /** Map from namespace URIs to ContentHandlerFactories */
     private Map factories = new java.util.HashMap();
-    
-    /**
-     * @return a singleton instance of the ContentHandlerFactoryRegistry.
-     */
-    public static ContentHandlerFactoryRegistry getInstance() {
-        if (instance == null) {
-            instance = new ContentHandlerFactoryRegistry();
-        }
-        return instance;
-    }
     
     /**
      * Default constructor.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org