You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Nils Meier <nm...@users.sourceforge.net> on 2006/02/24 03:51:25 UTC

RendererFactory - hardcoded list of RendererMakers

Hi 

I was thinking about packaging a smaller subset of FOP 
with only those renderers inside that are necessary 
(in the end I decided against it for the moment since 
the size benefit didn't seem to warrant it).

I noticed though that the type RendererFactory has a 
hardcoded list of RendererMakers in one of its 
initializers "registerStandardRenderers()"

Since FOP apparently uses sun's Service API anyways
I'd suggest to use it here as well. Just a thought,
there might be something I'm missing.

Applied patch adds the dynamic lookup in the
factory and the necessary service definition file
residing in META-INF.

Regards
Nils

Re: RendererFactory - hardcoded list of RendererMakers

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Mar 5, 2006, at 20:52, Andreas L Delmelle wrote:

> On Feb 24, 2006, at 03:51, Nils Meier wrote:
>
> Hi Nils,
>
> Just noticed this one has gone unanswered so far...
>
>> <snip />
>> Applied patch adds the dynamic lookup in the
>> factory and the necessary service definition file
>> residing in META-INF.
>
> I kind of liked this idea, but would prefer to use FOP's own  
> org.apache.fop.util.Service for that.
>
> see commit: http://svn.apache.org/viewcvs?rev=383384&view=rev

BTW, any devs object to doing the same for *all* default  
ElementMappings?

Index: src/java/META-INF/services/org.apache.fop.fo.ElementMapping
===================================================================
--- src/java/META-INF/services/org.apache.fop.fo.ElementMapping  
(revision 0)
+++ src/java/META-INF/services/org.apache.fop.fo.ElementMapping  
(revision 0)
@@ -0,0 +1,7 @@
+org.apache.fop.fo.FOElementMapping
+org.apache.fop.fo.extensions.svg.SVGElementMapping
+org.apache.fop.fo.extensions.svg.BatikExtensionElementMapping
+org.apache.fop.fo.extensions.ExtensionElementMapping
+org.apache.fop.fo.extensions.xmp.XMPElementMapping
+org.apache.fop.fo.extensions.xmp.RDFElementMapping
+org.apache.fop.render.ps.extensions.PSExtensionElementMapping
\ No newline at end of file
Index: src/java/org/apache/fop/fo/ElementMappingRegistry.java
===================================================================
--- src/java/org/apache/fop/fo/ElementMappingRegistry.java       
(revision 382930)
+++ src/java/org/apache/fop/fo/ElementMappingRegistry.java       
(working copy)
@@ -74,14 +74,6 @@
       * Sets all the element and property list mappings to their  
default values.
       */
      private void setupDefaultMappings() {
-        addElementMapping("org.apache.fop.fo.FOElementMapping");
-        addElementMapping 
("org.apache.fop.fo.extensions.svg.SVGElementMapping");
-        addElementMapping 
("org.apache.fop.fo.extensions.svg.BatikExtensionElementMapping");
-        addElementMapping 
("org.apache.fop.fo.extensions.ExtensionElementMapping");
-        addElementMapping 
("org.apache.fop.fo.extensions.xmp.XMPElementMapping");
-        addElementMapping 
("org.apache.fop.fo.extensions.xmp.RDFElementMapping");
-        addElementMapping 
("org.apache.fop.render.ps.extensions.PSExtensionElementMapping");
-
          // add mappings from available services
          Iterator providers = Service.providers(ElementMapping.class);
          if (providers != null) {

Cheers,

Andreas

Re: RendererFactory - hardcoded list of RendererMakers

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Feb 24, 2006, at 03:51, Nils Meier wrote:

Hi Nils,

Just noticed this one has gone unanswered so far...

> <snip />
> Applied patch adds the dynamic lookup in the
> factory and the necessary service definition file
> residing in META-INF.

I kind of liked this idea, but would prefer to use FOP's own  
org.apache.fop.util.Service for that.

see commit: http://svn.apache.org/viewcvs?rev=383384&view=rev

Cheers,

Andreas