]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Refactor: Extract method FObj.getPropertiesForNamespace() from PropertyListBuilder...
authorWilliam Victor Mote <vmote@apache.org>
Thu, 1 May 2003 04:42:43 +0000 (04:42 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Thu, 1 May 2003 04:42:43 +0000 (04:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196381 13f79535-47bb-0310-9956-ffa450edef68

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

index 650d8c7d8fb0182b76164d98d7d83b4712dbd6a5..9caf7af97474c879e1645498037dbec3a85d7f7c 100644 (file)
@@ -172,6 +172,16 @@ public class FObj extends FONode {
       return (FObj)par;
     }
 
+    public PropertyList getPropertiesForNamespace(String nameSpaceURI) {
+        if (this.properties == null) {
+            return null;
+        }
+        if (! nameSpaceURI.equals(this.properties.getNameSpace())) {
+            return null;
+        }
+        return this.properties;
+    }
+
     protected PropertyManager makePropertyManager(
       PropertyList propertyList) {
         return new PropertyManager(propertyList);
index e0addaed5ef6c3a557f8447bc51faf70ec165eac..2c49f2e6ecd2ef4a1a8d7d2b763442f5531bc45a 100644 (file)
@@ -138,18 +138,12 @@ public class PropertyListBuilder {
             nameSpaceURIToUse = nameSpaceURI;
         }
         FObj parentFO = fo.findNearestAncestorFObj();
-
-        PropertyList parentPropertyList = null;
+        PropertyList parentProperties = null;
         if (parentFO != null) {
-            parentPropertyList = parentFO.properties;
-        }
-        PropertyList par = null;
-        if (parentPropertyList != null
-                && nameSpaceURIToUse.equals(parentPropertyList.getNameSpace())) {
-            par = parentPropertyList;
+            parentProperties = parentFO.getPropertiesForNamespace(nameSpaceURIToUse);
         }
 
-        PropertyList p = new PropertyList(par, nameSpaceURIToUse,
+        PropertyList p = new PropertyList(parentProperties, nameSpaceURIToUse,
                                           elementName);
         p.setBuilder(this);
         HashMap table;