Revision: 7585
Author: victormote
Date: 2006-06-14 09:15:58 -0700 (Wed, 14 Jun 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7585&view=rev
Log Message:
-----------
Validate the children.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 16:10:13 UTC (rev 7584)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2006-06-14 16:15:58 UTC (rev 7585)
@@ -24,6 +24,7 @@
package org.foray.fotree.fo.obj;
+import org.foray.fotree.FONode;
import org.foray.fotree.FObj;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
@@ -64,6 +65,7 @@
}
public void start() throws FOTreeException {
+ /* Validate properties. */
String masterName = this.traitMasterName(null);
if (masterName == null) {
logWarning(getFullName() + " has no page-master-name, and will be "
@@ -73,6 +75,20 @@
}
}
+ public void end() throws FOTreeException {
+ /* Validate children. Every child should be a SubSequenceSpecifier. */
+ for (int i = 0; i < this.children.size(); i++) {
+ Object child = this.children.get(i);
+ if (! (child instanceof SubSequenceSpecifier)) {
+ FONode node = (FONode) child;
+ node.throwException("Child of fo:page-sequence-master must be\n"
+ + " fo:single-page-master-reference,\n"
+ + " fo:repeatable-page-master-reference,\n"
+ + " or fo:repeatable-page-master-alternatives.");
+ }
+ }
+ }
+
/**
* The parent.
* @return The parent, properly cast.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|