From c5f21d1021bcbabaadef7f4d85f521b74940e9f9 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Thu, 3 Aug 2000 06:16:23 +0000 Subject: [PATCH] handles separate prop lists git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193597 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/XTFOTreeBuilder.java | 46 ++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/org/apache/fop/fo/XTFOTreeBuilder.java b/src/org/apache/fop/fo/XTFOTreeBuilder.java index b4cd6a899..48ee7220e 100644 --- a/src/org/apache/fop/fo/XTFOTreeBuilder.java +++ b/src/org/apache/fop/fo/XTFOTreeBuilder.java @@ -81,8 +81,9 @@ public class XTFOTreeBuilder extends HandlerBase { /** * class that builds a property list for each formatting object */ - protected PropertyListBuilder propertyListBuilder = new - PropertyListBuilder(); + protected Hashtable propertylistTable = new Hashtable(); +// protected PropertyListBuilder propertyListBuilder = new +// PropertyListBuilder(); /** * current formatting object being handled @@ -162,6 +163,44 @@ public class XTFOTreeBuilder extends HandlerBase { this.fobjTable.put(namespaceURI + "^" + localName, maker); } + /** + * add a mapping from element name to maker. + * + * @param namespaceURI namespace URI of formatting object element + * @param localName local name of formatting object element + * @param maker Maker for class representing formatting object + */ + public void addPropertyList(String namespaceURI, Hashtable list) { + PropertyListBuilder plb; + plb = (PropertyListBuilder)this.propertylistTable.get(namespaceURI); + if(plb == null) { + plb = new PropertyListBuilder(); + plb.addList(list); + this.propertylistTable.put(namespaceURI, plb); + } else { + plb.addList(list); + } + } + + /** + * add a mapping from element name to maker. + * + * @param namespaceURI namespace URI of formatting object element + * @param localName local name of formatting object element + * @param maker Maker for class representing formatting object + */ + public void addElementPropertyList(String namespaceURI, String localName, Hashtable list) { + PropertyListBuilder plb; + plb = (PropertyListBuilder)this.propertylistTable.get(namespaceURI); + if(plb == null) { + plb = new PropertyListBuilder(); + plb.addElementList(localName, list); + this.propertylistTable.put(namespaceURI, plb); + } else { + plb.addElementList(localName, list); + } + } + /** SAX Handler for characters */ public void characters(char data[], int start, int length) { currentFObj.addCharacters(data, start, start + length); @@ -212,6 +251,7 @@ public class XTFOTreeBuilder extends HandlerBase { String fullName = mapName(rawName); fobjMaker = (FObj.Maker) fobjTable.get(fullName); + PropertyListBuilder plBuilder = (PropertyListBuilder)this.propertylistTable.get(uri); if (fobjMaker == null) { if (!this.unknownFOs.containsKey(fullName)) { @@ -223,7 +263,7 @@ public class XTFOTreeBuilder extends HandlerBase { } try { - PropertyList list = this.propertyListBuilder.makeList(fullName, attlist, + PropertyList list = plBuilder.makeList(fullName, attlist, (currentFObj == null) ? null : currentFObj.properties); fobj = fobjMaker.make(currentFObj, list); } catch (FOPException e) { -- 2.39.5