pbwest 2002/09/17 22:55:24
Modified: src/org/apache/fop/datatypes Tag: FOP_0-20-0_Alt-Design
InheritedValue.java
Log:
Changes to validate().
Revision Changes Path
No revision
No revision
1.1.2.2 +15 -21 xml-fop/src/org/apache/fop/datatypes/Attic/InheritedValue.java
Index: InheritedValue.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/Attic/InheritedValue.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- InheritedValue.java 15 Sep 2002 05:47:50 -0000 1.1.2.1
+++ InheritedValue.java 18 Sep 2002 05:55:24 -0000 1.1.2.2
@@ -4,6 +4,8 @@
import org.apache.fop.fo.expr.PropertyValue;
import org.apache.fop.fo.expr.PropertyTriplet;
import org.apache.fop.fo.Properties;
+import org.apache.fop.fo.PropNames;
+import org.apache.fop.fo.PropertyConsts;
import org.apache.fop.datatypes.IndirectValue;
/*
@@ -88,30 +90,22 @@
/**
* validate the <i>InheritedValue</i> against the associated property.
+ * TODO: validate is a total mess. It will all require a rethink
+ * when the expression parsing is being finalised.
+ * @param type - an <tt>int</tt> bitmap of datatypes. Irrelevant here.
*/
- public void validate(int property) throws PropertyException {
+ public void validate(int type) throws PropertyException {
String propStr = "Unknown";
String spropStr = "Unknown";
- int sprop = getSourceProperty();
- if (property != sprop) {
- try {
- propStr = PropNames.getPropertyName(this.property);
- spropStr = PropNames.getPropertyName(sprop);
- } catch (PropertyException e) {}
- throw new PropertyException
- ("InheritedValue for property " + this.property
- + " (" + propStr + ") can only be validated against its "
- + "source property " + sprop + " (" + spropStr + ").");
- }
// Property must be inheritable
- if (PropertyConsts.inheritance(sprop) == Properties.NO) {
+ if (PropertyConsts.inheritance(sourceProperty) == Properties.NO) {
try {
- propStr = PropNames.getPropertyName(this.property);
- spropStr = PropNames.getPropertyName(sprop);
+ propStr = PropNames.getPropertyName(property);
+ spropStr = PropNames.getPropertyName(sourceProperty);
} catch (PropertyException e) {}
throw new PropertyException
- ("Source property " + sprop + " (" + spropStr + ") for "
- + this.property + " (" + propStr
+ ("Source property " + sourceProperty + " (" + spropStr
+ + ") for " + this.property + " (" + propStr
+ ") is not inheritable.");
}
}
@@ -120,7 +114,7 @@
* validate the <i>InheritedValue</i> against the <i>source</i> property.
*/
public void validate() throws PropertyException {
- validate(getSourceProperty());
+ validate(Properties.ANY_TYPE);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]