aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/pagination/Flow.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/Flow.java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/Flow.java30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index ac2911e9d..d7cc88cf3 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
// FOP
import org.apache.fop.fo.FONode;
@@ -63,6 +64,28 @@ public class Flow extends FObj {
}
/**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL/FOP Content Model: (%block;)+
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName) {
+ if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ }
+ }
+
+ /**
+ * Make sure content model satisfied, if so then tell the
+ * StructureRenderer that we are at the end of the flow.
+ * @see org.apache.fop.fo.FONode#end
+ */
+ protected void end() {
+ if (children == null) {
+ missingChildElementError("(%block;)+");
+ }
+ getFOInputHandler().endFlow(this);
+ }
+
+ /**
* @see org.apache.fop.fo.FObj#addProperties
*/
protected void addProperties(Attributes attlist) throws FOPException {
@@ -96,13 +119,6 @@ public class Flow extends FObj {
}
/**
- * Tell the StructureRenderer that we are at the end of the flow.
- */
- protected void end() {
- getFOInputHandler().endFlow(this);
- }
-
- /**
* @param name the name of the flow to set
* @throws FOPException for an empty name
*/