From: Jeremias Maerki Date: Fri, 18 Mar 2005 08:11:48 +0000 (+0000) Subject: Convenience method for checking "auto" enum value on a property. Makes code more... X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=11b33608e1cfd3526460c11dff74c0493c0425fd;p=xmlgraphics-fop.git Convenience method for checking "auto" enum value on a property. Makes code more readable. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198506 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java index 555b9ea3c..3d4dbe65d 100644 --- a/src/java/org/apache/fop/fo/properties/Property.java +++ b/src/java/org/apache/fop/fo/properties/Property.java @@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; +import org.apache.fop.fo.Constants; /** * Base class for all property objects @@ -126,6 +127,11 @@ public class Property { return 0; } + /** @return true if the property is an enum and has value 'auto' */ + public boolean isAuto() { + return (getEnum() == Constants.EN_AUTO); + } + /** * This method expects to be overridden by subclasses * @return char property value