]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
1. Created own logger for AbstractRenderer, removed logger setter from Renderer inter...
authorGlen Mazza <gmazza@apache.org>
Sun, 20 Jun 2004 07:46:13 +0000 (07:46 +0000)
committerGlen Mazza <gmazza@apache.org>
Sun, 20 Jun 2004 07:46:13 +0000 (07:46 +0000)
2. Validity checking for fo:repeatable-page-master-alternatives.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197739 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/Driver.java
src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
src/java/org/apache/fop/render/AbstractRenderer.java
src/java/org/apache/fop/render/Renderer.java
src/java/org/apache/fop/tools/AreaTreeBuilder.java

index 7b0cece47b8b082f47d7ac7f649f974e937e2265..cf4395a948b6a6faf5b03e35c4de5d8e43932c21 100644 (file)
@@ -409,7 +409,6 @@ public class Driver {
                 throws IllegalArgumentException {
         try {
             renderer = (Renderer)Class.forName(rendererClassName).newInstance();
-            renderer.setLogger(getLogger());
             renderer.setProducer(Version.getVersion());
             renderer.setUserAgent(getUserAgent());
         } catch (ClassNotFoundException e) {
index 3101df6e6a1de8404f6f8d61b604f7be84d2d105..e2919c3de2e2054500848f1be2965ba3074ba9ed 100644 (file)
@@ -69,6 +69,9 @@ public class LayoutMasterSet extends FObj {
         }
     }
 
+    /**
+     * @see org.apache.fop.fo.FONode#end
+     */
     protected void end() {
         if (children == null) {
            missingChildElementError("(simple-page-master|page-sequence-master)+");
index 93b688734ee89fd374e57887532352053c22952a..701270343aa4a5e13106003d4b5f79c407d9e44a 100644 (file)
@@ -23,8 +23,10 @@ import java.util.ArrayList;
 
 // XML
 import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
 
 // FOP
+import org.apache.fop.fo.FOElementMapping;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FOTreeVisitor;
@@ -57,6 +59,26 @@ public class RepeatablePageMasterAlternatives extends FObj
         super(parent);
     }
 
+    /**
+     * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+        XSL/FOP: (conditional-page-master-reference+)
+     */
+    protected void validateChildNode(Locator loc, String nsURI, String localName) {
+        if (!(nsURI == FOElementMapping.URI &&
+            localName.equals("conditional-page-master-reference"))) {
+                invalidChildError(loc, nsURI, localName);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.fo.FONode#end
+     */
+    protected void end() {
+        if (children == null) {
+           missingChildElementError("(conditional-page-master-reference+)");
+        }
+    }
+
     /**
      * @see org.apache.fop.fo.FObj#addProperties
      */
index c76b8f3b652edbf360a5bfd11a1a1da37fc23413..53a6f3b0a9e227ae6a90fd60bc5f0f5b9b2c1339 100644 (file)
@@ -64,6 +64,7 @@ import org.apache.fop.fo.Constants;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fo.pagination.Region;
 import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 // Avalon
 import org.apache.avalon.framework.configuration.Configurable;
@@ -86,8 +87,8 @@ public abstract class AbstractRenderer
     /**
      * logging instance
      */
-    protected Log logger = null;
-
+    protected static Log logger = LogFactory.getLog("Renderer");
+    
     /**
      * producer (usually "FOP")
      */
@@ -141,14 +142,6 @@ public abstract class AbstractRenderer
     public void configure(Configuration conf) throws ConfigurationException {
     }
 
-    /**
-     * Sets the Commons-Logging instance for this class
-     * @param logger The Commons-Logging instance
-     */
-    public void setLogger(Log logger) {
-        this.logger = logger;
-    }
-
     /**
      * Returns the Commons-Logging instance for this class
      * @return  The Commons-Logging instance
index d977e6a40eeffcec50759341b58a37334033ead2..6ca5ad7089c70ccc41fff9e0910c893ba0533cde 100644 (file)
@@ -187,13 +187,6 @@ public interface Renderer {
      * @param cont  The inline container area
      */
     void renderContainer(Container cont);
-    
-    /**
-     * Tells the renderer to render an inline container.
-     *
-     * @param cont  The inline container area
-     */
-    void setLogger(Log logger);
 
 }
 
index d2d0baff951f7694fca8590460d0cbfc51e2cb8a..37b923d7994e21969ef2821c190f46af740f142f 100644 (file)
@@ -159,7 +159,6 @@ public class AreaTreeBuilder {
             rend = new SVGRenderer();
         }
 
-        rend.setLogger(logger);
         FontInfo fontInfo = new FontInfo();
         rend.setupFontInfo(fontInfo);
         FOUserAgent ua = new FOUserAgent();