From a054ab3b7e22af6c163b5d68c04bf5868958a59e Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Wed, 31 Mar 2004 10:55:07 +0000 Subject: PR: Obtained from: Submitted by: Reviewed by: Conversion of Avalon to Commons-Logger. (Will still need to update the examples, which I will take care of next; Jeremias will be modifying the PDF libraries for more efficient use of the CL loggers.) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197474 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/fo/pagination/PageNumberGenerator.java | 27 +++++++++++++++++++--- .../org/apache/fop/fo/pagination/PageSequence.java | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java index f5871c7bd..47a84dab5 100644 --- a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java +++ b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java @@ -18,21 +18,26 @@ package org.apache.fop.fo.pagination; -// Avalon -import org.apache.avalon.framework.logger.AbstractLogEnabled; +import org.apache.commons.logging.Log; + /** * This class uses the 'format', 'groupingSeparator', 'groupingSize', * and 'letterValue' properties on fo:page-sequence to return a String * corresponding to the supplied integer page number. */ -public class PageNumberGenerator extends AbstractLogEnabled { +public class PageNumberGenerator { private String format; private char groupingSeparator; private int groupingSize; private int letterValue; + /** + * logging instance + */ + protected Log logger = null; + // constants private static final int DECIMAL = 1; // '0*1' private static final int LOWERALPHA = 2; // 'a' @@ -101,6 +106,22 @@ public class PageNumberGenerator extends AbstractLogEnabled { } } + /** + * 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 + */ + protected Log getLogger(Log logger) { + return logger; + } + /** * Formats a page number. * @param number page number to format diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 125908705..6f28944e2 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -196,7 +196,7 @@ public class PageSequence extends FObj { this.propertyList.get(PR_GROUPING_SEPARATOR).getCharacter(), this.propertyList.get(PR_GROUPING_SIZE).getNumber().intValue(), this.propertyList.get(PR_LETTER_VALUE).getEnum()); - this.pageNumberGenerator.enableLogging(getLogger()); + this.pageNumberGenerator.setLogger(getLogger()); this.forcePageCount = this.propertyList.get(PR_FORCE_PAGE_COUNT).getEnum(); -- cgit v1.2.3