From 385c5eef153de8f3368a87915a3553a73a833835 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 27 Mar 2006 18:01:20 +0000 Subject: [PATCH] Fixed addition of ElementMapping instances. Witnessed in the FO tree tests. The ElementMapping list is not necessary since we now have the ElementMappingRegistry. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389212 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/FopFactory.java | 16 +--------------- .../apache/fop/fo/ElementMappingRegistry.java | 15 +++++---------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/java/org/apache/fop/apps/FopFactory.java b/src/java/org/apache/fop/apps/FopFactory.java index 832004195..cd1f4c4d7 100644 --- a/src/java/org/apache/fop/apps/FopFactory.java +++ b/src/java/org/apache/fop/apps/FopFactory.java @@ -108,9 +108,6 @@ public class FopFactory { /** @see #setBreakIndentInheritanceOnReferenceAreaBoundary(boolean) */ private boolean breakIndentInheritanceOnReferenceAreaBoundary = false; - /** Additional fo.ElementMapping subclasses set by user */ - private List additionalElementMappings = null; - /** Optional overriding LayoutManagerMaker */ private LayoutManagerMaker lmMakerOverride = null; @@ -260,18 +257,7 @@ public class FopFactory { * @param elementMapping the class name representing the element mapping. */ public void addElementMapping(ElementMapping elementMapping) { - if (additionalElementMappings == null) { - additionalElementMappings = new java.util.ArrayList(); - } - additionalElementMappings.add(elementMapping); - } - - /** - * Returns the List of user-added ElementMapping class names - * @return List of Strings holding ElementMapping names. - */ - public List getAdditionalElementMappings() { - return additionalElementMappings; + this.elementMappingRegistry.addElementMapping(elementMapping); } /** diff --git a/src/java/org/apache/fop/fo/ElementMappingRegistry.java b/src/java/org/apache/fop/fo/ElementMappingRegistry.java index 787d17b48..3636500e0 100644 --- a/src/java/org/apache/fop/fo/ElementMappingRegistry.java +++ b/src/java/org/apache/fop/fo/ElementMappingRegistry.java @@ -59,15 +59,6 @@ public class ElementMappingRegistry { public ElementMappingRegistry(FopFactory factory) { // Add standard element mappings setupDefaultMappings(); - - // add additional ElementMappings defined within FOUserAgent - List addlEMs = factory.getAdditionalElementMappings(); - - if (addlEMs != null) { - for (int i = 0; i < addlEMs.size(); i++) { - addElementMapping((ElementMapping) addlEMs.get(i)); - } - } } /** @@ -116,7 +107,11 @@ public class ElementMappingRegistry { } } - private void addElementMapping(ElementMapping mapping) { + /** + * Add the element mapping. + * @param mapping the element mapping instance + */ + public void addElementMapping(ElementMapping mapping) { this.fobjTable.put(mapping.getNamespaceURI(), mapping.getTable()); this.namespaces.put(mapping.getNamespaceURI().intern(), mapping); } -- 2.39.5