pbwest 2004/06/17 04:18:38
Modified: src/java/org/apache/fop/datatypes Tag: FOP_0-20-0_Alt-Design
IntegerType.java
Log:
Added static getIntValue(PropertyValue)
Revision Changes Path
No revision
No revision
1.1.2.3 +17 -2 xml-fop/src/java/org/apache/fop/datatypes/Attic/IntegerType.java
Index: IntegerType.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Attic/IntegerType.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- IntegerType.java 19 Feb 2004 03:11:55 -0000 1.1.2.2
+++ IntegerType.java 17 Jun 2004 11:18:38 -0000 1.1.2.3
@@ -79,6 +79,21 @@
}
/**
+ * Return the int value from a PropertyValue.
+ * @param pv
+ * @return the int value
+ * @exception PropertyException if the <code>PropertyValue</code> is not
+ * an <code>IntegerType</code>
+ */
+ public static int getIntValue(PropertyValue pv)
+ throws PropertyException {
+ if (pv.getType() == PropertyValue.INTEGER) {
+ return ((IntegerType)pv).getInt();
+ }
+ throw new PropertyException("PropertyValue not an INTEGER type");
+ }
+
+ /**
* validate the <i>IntegerType</i> against the associated property.
*/
public void validate() throws PropertyException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]