aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/PropertyList.java
diff options
context:
space:
mode:
authorDirk-Willem van Gulik <dirkx@apache.org>1999-11-08 19:12:49 +0000
committerDirk-Willem van Gulik <dirkx@apache.org>1999-11-08 19:12:49 +0000
commit10070e8383ff94f3f256e346b8c4a2a493533cfb (patch)
tree59080d7faae7c0bd9ff4e5a48f4df4394d468a02 /src/org/apache/fop/fo/PropertyList.java
parentb510e7f15a798e944bb138993f2b586413adecbe (diff)
downloadxmlgraphics-fop-10070e8383ff94f3f256e346b8c4a2a493533cfb.tar.gz
xmlgraphics-fop-10070e8383ff94f3f256e346b8c4a2a493533cfb.zip
Initial revision
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193213 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/PropertyList.java')
-rw-r--r--src/org/apache/fop/fo/PropertyList.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/org/apache/fop/fo/PropertyList.java b/src/org/apache/fop/fo/PropertyList.java
new file mode 100644
index 000000000..e3a6092b7
--- /dev/null
+++ b/src/org/apache/fop/fo/PropertyList.java
@@ -0,0 +1,41 @@
+package org.apache.xml.fop.fo;
+
+import java.util.Hashtable;
+
+import org.apache.xml.fop.apps.FOPException;
+
+public class PropertyList extends Hashtable {
+ private PropertyListBuilder builder;
+ private PropertyList parentPropertyList = null;
+
+ public PropertyList(PropertyList parentPropertyList) {
+ this.parentPropertyList = parentPropertyList;
+ }
+
+ public Property get(String propertyName) {
+
+ if (builder == null)
+ System.err.println("OH OH, builder has not been set");
+ Property p = (Property)super.get(propertyName);
+
+ if (p == null) { // if not explicit
+ p = this.builder.computeProperty(this,propertyName);
+ if (p == null) { // else inherit
+ if ((this.parentPropertyList != null)&&(this.builder.isInherited(propertyName))) { // check for parent
+ p = this.parentPropertyList.get(propertyName); // retrieve parent's value
+ } else { // default
+ try {
+ p = this.builder.makeProperty(this,propertyName);
+ } catch (FOPException e) {
+ // don't know what to do here
+ }
+ }
+ }
+ }
+ return p;
+ }
+
+ public void setBuilder(PropertyListBuilder builder) {
+ this.builder = builder;
+ }
+}