]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Make the shorthand parser API take a generic property rather than
authorFinn Bock <bckfnn@apache.org>
Tue, 7 Sep 2004 12:40:43 +0000 (12:40 +0000)
committerFinn Bock <bckfnn@apache.org>
Tue, 7 Sep 2004 12:40:43 +0000 (12:40 +0000)
demanding to be passed a ListProperty.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197924 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
src/java/org/apache/fop/fo/properties/PropertyMaker.java
src/java/org/apache/fop/fo/properties/ShorthandParser.java

index 54be5242193b5a9b05235a3dd6cf8e029eba562b..c8b92f64213f1bb798d2a412485f2c04e331e8ae 100644 (file)
@@ -33,7 +33,7 @@ public class GenericShorthandParser implements ShorthandParser {
      * @param index the index into the List of properties
      * @return the property from the List of properties at the index parameter
      */
-    protected Property getElement(ListProperty list, int index) {
+    protected Property getElement(Property list, int index) {
         if (list.getList().size() > index) {
             return (Property) list.getList().elementAt(index);
         } else {
@@ -44,18 +44,18 @@ public class GenericShorthandParser implements ShorthandParser {
     // Stores 1 to 3 values for border width, style, color
     // Used for: border, border-top, border-right etc
     public Property getValueForProperty(int propId,
-                                        ListProperty listProperty,
+                                        Property property,
                                         PropertyMaker maker,
                                         PropertyList propertyList) {
         Property prop = null;
         // Check for keyword "inherit"
-        if (listProperty.getList().size() == 1) {
-            String sval = getElement(listProperty, 0).getString();
+        if (property.getList().size() == 1) {
+            String sval = getElement(property, 0).getString();
             if (sval != null && sval.equals("inherit")) {
                 return propertyList.getFromParent(propId);
             }
         }
-        return convertValueForProperty(propId, listProperty, maker, propertyList);
+        return convertValueForProperty(propId, property, maker, propertyList);
     }
 
 
@@ -68,12 +68,12 @@ public class GenericShorthandParser implements ShorthandParser {
      * @return the Property matching the parameters, or null if not found
      */
     protected Property convertValueForProperty(int propId,
-                                               ListProperty listProperty,
+                                               Property property,
                                                PropertyMaker maker,
                                                PropertyList propertyList) {
         Property prop = null;
         // Try each of the stored values in turn
-        Enumeration eprop = listProperty.getList().elements();
+        Enumeration eprop = property.getList().elements();
         while (eprop.hasMoreElements() && prop == null) {
             Property p = (Property) eprop.nextElement();
             prop = maker.convertShorthandProperty(propertyList, p, null);
index 19048f9d7d48018da2edeff044fe1aadb350105e..a9d4a8e6b42e65edf47b8cd1912ac72a91763f6c 100644 (file)
@@ -601,15 +601,15 @@ public class PropertyMaker implements Cloneable {
         if (shorthands == null) {
             return null;
         }
-        ListProperty listprop;
+        Property prop;
         int n = shorthands.length;
         for (int i = 0; i < n && shorthands[i] != null; i++) {
             PropertyMaker shorthand = shorthands[i];
-            listprop = (ListProperty)propertyList.getExplicit(shorthand.propId);
-            if (listprop != null) {
+            prop = propertyList.getExplicit(shorthand.propId);
+            if (prop != null) {
                 ShorthandParser parser = shorthand.datatypeParser;
                 Property p = parser.getValueForProperty(getPropId(),
-                                        listprop, this, propertyList);
+                                        prop, this, propertyList);
                 if (p != null) {
                     return p;
                 }
index b8045b759dc5f54bf882308e12a04a3eb823239a..0d6b7b09a755ab4693e23f9e49911610edfadcc5 100644 (file)
@@ -33,7 +33,7 @@ public interface ShorthandParser {
      * @return Property object corresponding to propName
      */
     Property getValueForProperty(int propId,
-                                 ListProperty listProperty,
+                                 Property property,
                                  PropertyMaker maker,
                                  PropertyList propertyList);
 }