You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2002/08/27 17:22:50 UTC
cvs commit: xml-fop/src/org/apache/fop/fo/expr AbstractPropertyValue.java PropertyValue.java PropertyValueList.java
pbwest 2002/08/27 08:22:50
Modified: src/org/apache/fop/fo/expr Tag: FOP_0-20-0_Alt-Design
AbstractPropertyValue.java PropertyValue.java
PropertyValueList.java
Log:
Support for PropertyValue type field
Revision Changes Path
No revision
No revision
1.1.2.2 +22 -8 xml-fop/src/org/apache/fop/fo/expr/Attic/AbstractPropertyValue.java
Index: AbstractPropertyValue.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/Attic/AbstractPropertyValue.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- AbstractPropertyValue.java 7 May 2002 05:40:16 -0000 1.1.2.1
+++ AbstractPropertyValue.java 27 Aug 2002 15:22:50 -0000 1.1.2.2
@@ -30,23 +30,37 @@
protected int property;
/**
- * N.B. Constructor allows for property 0, which is a dummy
- * property number.
- * @param index <tt>int</tt> index of the property in the property arrays.
+ * An integer property type.
*/
- public AbstractPropertyValue(int index) throws PropertyException {
- if (index < 0 || index > PropNames.LAST_PROPERTY_INDEX)
+ public final int type;
+
+ /**
+ * @param index index of the property in the property arrays.
+ * @param type of this value
+ */
+ public AbstractPropertyValue(int index, int type)
+ throws PropertyException
+ {
+ if (index < 1 || index > PropNames.LAST_PROPERTY_INDEX)
throw new PropertyException("Invalid property index: " + index);
+ if (type < 1 || type > PropertyValue.LAST_PROPERTY_TYPE)
+ throw new PropertyException("Invalid property type: " + type);
property = index;
+ this.type = type;
}
/**
* @param propertyName a <tt>String</tt> containing the property name.
*/
- public AbstractPropertyValue(String propertyName)
+ public AbstractPropertyValue(String propertyName, int type)
throws PropertyException
{
property = PropertyConsts.getPropertyIndex(propertyName);
+ if (property < 1 || property > PropNames.LAST_PROPERTY_INDEX)
+ throw new PropertyException("Invalid property index: " + property);
+ if (type < 1 || type > PropertyValue.LAST_PROPERTY_TYPE)
+ throw new PropertyException("Invalid property type: " + type);
+ this.type = type;
}
/**
1.1.2.2 +34 -2 xml-fop/src/org/apache/fop/fo/expr/Attic/PropertyValue.java
Index: PropertyValue.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/Attic/PropertyValue.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- PropertyValue.java 7 May 2002 05:40:16 -0000 1.1.2.1
+++ PropertyValue.java 27 Aug 2002 15:22:50 -0000 1.1.2.2
@@ -19,6 +19,38 @@
public interface PropertyValue {
+ public static final int
+ NO_TYPE = 0
+ ,ANGLE = 1
+ ,AUTO = 1
+ ,BOOL = 1
+ ,COLOR_TYPE = 1
+ ,COUNTRY = 1
+ ,ENUM = 1
+ ,FONT_FAMILY = 1
+ ,FREQUENCY = 1
+ ,FROM_NEAREST_SPECIFIED = 1
+ ,FROM_PARENT = 1
+ ,INHERIT = 1
+ ,INTEGER = 1
+ ,LANGUAGE = 1
+ ,LITERAL = 1
+ ,MAPPED_NUMERIC = 1
+ ,MIME_TYPE = 1
+ ,NCNAME = 1
+ ,NONE = 1
+ ,NUMERIC = 1
+ ,SCRIPT = 1
+ ,SHADOW_EFFECT = 1
+ ,SLASH = 1
+ ,TEXT_DECORATIONS = 1
+ ,TEXT_DECORATOR = 1
+ ,TIME = 1
+ ,URI_TYPE = 1
+ ,LIST = 2
+
+ ,LAST_PROPERTY_TYPE = LIST;
+
/**
* @return <tt>int</tt> property index.
*/
1.1.2.2 +23 -4 xml-fop/src/org/apache/fop/fo/expr/Attic/PropertyValueList.java
Index: PropertyValueList.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/Attic/PropertyValueList.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- PropertyValueList.java 7 May 2002 05:40:16 -0000 1.1.2.1
+++ PropertyValueList.java 27 Aug 2002 15:22:50 -0000 1.1.2.2
@@ -33,11 +33,19 @@
protected int property;
/**
+ * An integer property type.
+ */
+ public final int type;
+
+ /**
* @param property <tt>int</tt> index of the property.
*/
- public PropertyValueList(int property) {
+ public PropertyValueList(int property) throws PropertyException {
super();
+ if (property < 1 || property > PropNames.LAST_PROPERTY_INDEX)
+ throw new PropertyException("Invalid property index: " + property);
this.property = property;
+ type = PropertyValue.LIST;
}
/**
@@ -48,6 +56,9 @@
{
super();
property = PropertyConsts.getPropertyIndex(propertyName);
+ if (property < 1 || property > PropNames.LAST_PROPERTY_INDEX)
+ throw new PropertyException("Invalid property index: " + property);
+ type = PropertyValue.LIST;
}
/**
@@ -59,14 +70,19 @@
* @exception IllegalArgumentException if the <tt>Collection</tt> is
* not a <i>PropertyValueList</i>.
*/
- public PropertyValueList(int property, Collection c) {
+ public PropertyValueList(int property, Collection c)
+ throws PropertyException
+ {
super(c);
// This test only follows the super() call because that call must
// be the first in a constructor.
if (! (c instanceof PropertyValueList))
throw new IllegalArgumentException
("Collection is not a PropertyValueList.");
+ if (property < 1 || property > PropNames.LAST_PROPERTY_INDEX)
+ throw new PropertyException("Invalid property index: " + property);
this.property = property;
+ type = PropertyValue.LIST;
}
/**
@@ -88,6 +104,9 @@
throw new IllegalArgumentException
("Collection is not a PropertyValueList.");
property = PropertyConsts.getPropertyIndex(propertyName);
+ if (property < 1 || property > PropNames.LAST_PROPERTY_INDEX)
+ throw new PropertyException("Invalid property index: " + property);
+ type = PropertyValue.LIST;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org