]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Refactor: Clean up API between FObj.handleAttrs() and PropertyListBuilder.makeList...
authorWilliam Victor Mote <vmote@apache.org>
Thu, 1 May 2003 03:32:24 +0000 (03:32 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Thu, 1 May 2003 03:32:24 +0000 (03:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196380 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FObj.java
src/java/org/apache/fop/fo/PropertyListBuilder.java

index 5eaff9f59702573f94b7a890d3aaa2f98eaaae84..650d8c7d8fb0182b76164d98d7d83b4712dbd6a5 100644 (file)
@@ -151,15 +151,10 @@ public class FObj extends FONode {
      * The attributes must be used immediately as the sax attributes
      * will be altered for the next element.
      * @param attlist Collection of attributes passed to us from the parser.
+     * @throws FOPException
      */
     public void handleAttrs(Attributes attlist) throws FOPException {
-        FObj par = findNearestAncestorFObj();
-        PropertyList props = null;
-        if (par != null) {
-            props = par.properties;
-        }
-        properties = getListBuilder().makeList(FO_URI, name, attlist, props,
-                                               par);
+        properties = getListBuilder().makeList(FO_URI, name, attlist, this);
         properties.setFObj(this);
         this.propMgr = makePropertyManager(properties);
         setWritingMode();
index fe8bdb2bcbbed95a89c56ca770d0878be09960a5..e0addaed5ef6c3a557f8447bc51faf70ec165eac 100644 (file)
@@ -117,20 +117,38 @@ public class PropertyListBuilder {
         return b;
     }
 
+    /**
+     *
+     * @param nameSpaceURI URI for the namespace of the element to which
+     *     the attributes belong.
+     * @param elementName Local name for the element to which the attributes
+     *     belong.
+     * @param attributes Collection of attributes passed to us from the parser.
+     * @param fo The FObj to which the attributes need to be attached as
+     *     properties.
+     * @return PropertyList object containing collection of Properties objects
+     *     appropriate for the FObj
+     * @throws FOPException
+     */
     public PropertyList makeList(String nameSpaceURI, String elementName,
                                  Attributes attributes,
-                                 PropertyList parentPropertyList,
-                                 FObj parentFO) throws FOPException {
+                                 FObj fo) throws FOPException {
         String nameSpaceURIToUse = "http://www.w3.org/TR/1999/XSL/Format";
         if (nameSpaceURI != null) {
             nameSpaceURIToUse = nameSpaceURI;
         }
+        FObj parentFO = fo.findNearestAncestorFObj();
 
+        PropertyList parentPropertyList = null;
+        if (parentFO != null) {
+            parentPropertyList = parentFO.properties;
+        }
         PropertyList par = null;
         if (parentPropertyList != null
                 && nameSpaceURIToUse.equals(parentPropertyList.getNameSpace())) {
             par = parentPropertyList;
         }
+
         PropertyList p = new PropertyList(par, nameSpaceURIToUse,
                                           elementName);
         p.setBuilder(this);