From 29741488f060797401a577e9537ff34ec6534151 Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Mon, 1 Sep 2003 19:21:07 +0000 Subject: move storage of ID references from fo/FOInputHandler to fo/FOTreeControl (implemented in apps/Document) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196886 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/Document.java | 17 +++++++++++++++++ src/java/org/apache/fop/fo/FOInputHandler.java | 18 ------------------ src/java/org/apache/fop/fo/FOTreeControl.java | 7 +++++++ src/java/org/apache/fop/fo/FObj.java | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) (limited to 'src/java/org') diff --git a/src/java/org/apache/fop/apps/Document.java b/src/java/org/apache/fop/apps/Document.java index 39bb24f49..caaeee71a 100644 --- a/src/java/org/apache/fop/apps/Document.java +++ b/src/java/org/apache/fop/apps/Document.java @@ -53,6 +53,9 @@ package org.apache.fop.apps; // Java import java.util.Map; import java.io.IOException; +import java.util.Set; +import java.util.HashSet; + // FOP import org.apache.fop.area.AreaTree; @@ -102,6 +105,12 @@ public class Document implements FOTreeControl, FOTreeListener { private Bookmarks bookmarks = null; + /** + * The current set of id's in the FO tree. + * This is used so we know if the FO tree contains duplicates. + */ + private Set idReferences = new HashSet(); + /** * Main constructor * @param driver the Driver object that is the "parent" of this Document @@ -366,5 +375,13 @@ public class Document implements FOTreeControl, FOTreeListener { return bookmarks; } + /** + * Retuns the set of ID references. + * @return the ID references + */ + public Set getIDReferences() { + return idReferences; + } + } diff --git a/src/java/org/apache/fop/fo/FOInputHandler.java b/src/java/org/apache/fop/fo/FOInputHandler.java index 4e605e61e..679ec3fe8 100644 --- a/src/java/org/apache/fop/fo/FOInputHandler.java +++ b/src/java/org/apache/fop/fo/FOInputHandler.java @@ -50,10 +50,6 @@ */ package org.apache.fop.fo; -// Java -import java.util.Set; -import java.util.HashSet; - // Avalon import org.apache.avalon.framework.logger.AbstractLogEnabled; @@ -86,12 +82,6 @@ import org.xml.sax.SAXException; * as our MIF and RTF output targets. */ public abstract class FOInputHandler extends AbstractLogEnabled { - /** - * The current set of id's in the FO tree. - * This is used so we know if the FO tree contains duplicates. - */ - private Set idReferences = new HashSet(); - /** * The FOTreeControl object that is controlling the FO Tree being built */ @@ -106,14 +96,6 @@ public abstract class FOInputHandler extends AbstractLogEnabled { this.foTreeControl = foTreeControl; } - /** - * Retuns the set of ID references. - * @return the ID references - */ - public Set getIDReferences() { - return idReferences; - } - /** * Returns the FontInfo object associated with this FOInputHandler. * @return the FontInof object diff --git a/src/java/org/apache/fop/fo/FOTreeControl.java b/src/java/org/apache/fop/fo/FOTreeControl.java index 2cf6cbc14..a77b6b2a8 100644 --- a/src/java/org/apache/fop/fo/FOTreeControl.java +++ b/src/java/org/apache/fop/fo/FOTreeControl.java @@ -53,6 +53,7 @@ package org.apache.fop.fo; // Java import java.util.Map; +import java.util.Set; // FOP import org.apache.fop.fo.extensions.Bookmarks; @@ -107,4 +108,10 @@ public interface FOTreeControl { */ Bookmarks getBookmarks(); + /** + * Returns the set of ID references found in the FO Tree. + * @return the ID references + */ + Set getIDReferences(); + } diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 5cce1eea0..b1510f269 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -285,7 +285,7 @@ public class FObj extends FONode { if (prop != null) { String str = prop.getString(); if (str != null && !str.equals("")) { - Set idrefs = foInputHandler.getIDReferences(); + Set idrefs = getFOTreeControl().getIDReferences(); if (!idrefs.contains(str)) { id = str; idrefs.add(id); -- cgit v1.2.3