aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-07-05 23:47:56 +0000
committerGlen Mazza <gmazza@apache.org>2004-07-05 23:47:56 +0000
commit671f7a301437b0dd5d10e49ea9c3e22bc3321748 (patch)
treef1bd49e8810224b50ee2efe3276ca9055b248852 /src/java/org/apache
parentb4004d6e654286b543db6404a357b2b84c00658d (diff)
downloadxmlgraphics-fop-671f7a301437b0dd5d10e49ea9c3e22bc3321748.tar.gz
xmlgraphics-fop-671f7a301437b0dd5d10e49ea9c3e22bc3321748.zip
1.) Moved DocumentInputSource & DocumentReader to apps package, made private
to package. 2.) Added validity checking to fo:static-content. 3.) Bug with uninitialized FOUserAgent in Driver fixed (this will probably need more analysis later.) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197753 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/apps/DocumentInputSource.java (renamed from src/java/org/apache/fop/tools/DocumentInputSource.java)4
-rw-r--r--src/java/org/apache/fop/apps/DocumentReader.java (renamed from src/java/org/apache/fop/tools/DocumentReader.java)4
-rw-r--r--src/java/org/apache/fop/apps/Driver.java5
-rw-r--r--src/java/org/apache/fop/fo/pagination/Flow.java2
-rw-r--r--src/java/org/apache/fop/fo/pagination/StaticContent.java28
5 files changed, 35 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/tools/DocumentInputSource.java b/src/java/org/apache/fop/apps/DocumentInputSource.java
index 92fc6ed9d..cff13693d 100644
--- a/src/java/org/apache/fop/tools/DocumentInputSource.java
+++ b/src/java/org/apache/fop/apps/DocumentInputSource.java
@@ -16,7 +16,7 @@
/* $Id$ */
-package org.apache.fop.tools;
+package org.apache.fop.apps;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@@ -26,7 +26,7 @@ import org.xml.sax.InputSource;
*
* @author Kelly A Campbell
*/
-public class DocumentInputSource extends InputSource {
+class DocumentInputSource extends InputSource {
private Document document;
diff --git a/src/java/org/apache/fop/tools/DocumentReader.java b/src/java/org/apache/fop/apps/DocumentReader.java
index db2fe6c64..624676192 100644
--- a/src/java/org/apache/fop/tools/DocumentReader.java
+++ b/src/java/org/apache/fop/apps/DocumentReader.java
@@ -16,7 +16,7 @@
/* $Id$ */
-package org.apache.fop.tools;
+package org.apache.fop.apps;
import java.io.IOException;
@@ -46,7 +46,7 @@ import org.xml.sax.helpers.AttributesImpl;
*
*/
-public class DocumentReader implements XMLReader {
+class DocumentReader implements XMLReader {
// //////////////////////////////////////////////////////////////////
// Configuration.
diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java
index ed4f3b50e..e5ffada6e 100644
--- a/src/java/org/apache/fop/apps/Driver.java
+++ b/src/java/org/apache/fop/apps/Driver.java
@@ -38,8 +38,6 @@ import org.apache.fop.fo.FOTreeHandler;
import org.apache.fop.render.awt.AWTRenderer;
import org.apache.fop.render.mif.MIFHandler;
import org.apache.fop.render.rtf.RTFHandler;
-import org.apache.fop.tools.DocumentInputSource;
-import org.apache.fop.tools.DocumentReader;
/**
* Primary class that drives overall FOP process.
@@ -163,6 +161,9 @@ public class Driver implements Constants {
throw new IllegalStateException("Driver already initialized");
}
treeBuilder = new FOTreeBuilder();
+ if (foUserAgent == null) {
+ foUserAgent = new FOUserAgent();
+ }
}
/**
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index 6d8b7966d..d4aa1f1f5 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -73,7 +73,7 @@ public class Flow extends FObj {
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL/FOP Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName) {
+ protected void validateChildNode(Locator loc, String nsURI, String localName) {
if (nsURI == FOElementMapping.URI && localName.equals("marker")) {
if (blockItemFound) {
nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
diff --git a/src/java/org/apache/fop/fo/pagination/StaticContent.java b/src/java/org/apache/fop/fo/pagination/StaticContent.java
index 6fe6a67f1..f33e70371 100644
--- a/src/java/org/apache/fop/fo/pagination/StaticContent.java
+++ b/src/java/org/apache/fop/fo/pagination/StaticContent.java
@@ -18,10 +18,15 @@
package org.apache.fop.fo.pagination;
+// XML
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
// FOP
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.apps.FOPException;
/**
* Class modelling the fo:static-content object. See Sec. 6.4.19 of the XSL-FO
@@ -40,6 +45,27 @@ public class StaticContent extends Flow {
}
/**
+ * @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;)+");
+ }
+ }
+
+ /**
* flowname checking is more stringient for static content currently
* @param name the flow-name to set
* @throws FOPException for a missing flow name