]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added resolve() method.
authorPeter Bernard West <pbwest@apache.org>
Wed, 18 Sep 2002 05:46:55 +0000 (05:46 +0000)
committerPeter Bernard West <pbwest@apache.org>
Wed, 18 Sep 2002 05:46:55 +0000 (05:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195214 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/datatypes/FromNearestSpecified.java

index d2479f25cbcf215e0019237f82eadaef270a6b59..342ac804fb38bb96268fd12aef16c3ac9844be1e 100644 (file)
@@ -4,6 +4,7 @@ import org.apache.fop.datatypes.IndirectValue;
 import org.apache.fop.fo.expr.PropertyValue;
 import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.Properties;
+import org.apache.fop.fo.FONode;
 
 /*
  * $Id$
@@ -77,6 +78,23 @@ public class FromNearestSpecified extends IndirectValue {
         super(propertyName, PropertyValue.FROM_NEAREST_SPECIFIED);
     }
 
+    /**
+     * Attempt to resolve this object into a "real" property value.  If the
+     * object has no <i>inheritedTriplet</i>, obtain and set one.  The
+     * obtained triplet is from the nearest ancestor node on which a value
+     * has been specified.
+     * Then invoke the superclass' <i>resolve()</i> method.
+     * @param node - the <tt>FONode</tt> with which this object is associated.
+     * @return the resulting <tt>PropertyValue</tt>.  Either a resolved value
+     * or <i>this</i>, if bequeathing triplet has no resolved computed value.
+     */
+    public PropertyValue resolve(FONode node) throws PropertyException {
+        if (inheritedValue == null) {
+            inheritedValue = node.getNearestSpecifiedTriplet(sourceProperty);
+        }
+        return super.resolve(node);
+    }
+
     /**
      * validate the <i>FromNearestSpecified</i> against the associated
      * property.