craigmcc 01/05/21 21:06:29
Modified: digester/src/java/org/apache/commons/digester Digester.java
Log:
Make getRules() have package scope, and add package-scoped getRegistrations(),
to facilitate unit testing.
Revision Changes Path
1.3 +17 -6
jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java
Index: Digester.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Digester.java 2001/05/12 17:25:53 1.2
+++ Digester.java 2001/05/22 04:06:27 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.2 2001/05/12 17:25:53 sanders Exp $
- * $Revision: 1.2 $
- * $Date: 2001/05/12 17:25:53 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.3 2001/05/22 04:06:27 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/05/22 04:06:27 $
*
* ====================================================================
*
@@ -73,6 +73,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.apache.commons.collections.ArrayStack;
@@ -103,7 +104,7 @@
* even from the same thread.</p>
*
* @author Craig McClanahan
- * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:53 $
+ * @version $Revision: 1.3 $ $Date: 2001/05/22 04:06:27 $
*/
public class Digester extends DefaultHandler {
@@ -1160,10 +1161,20 @@
}
- // ------------------------------------------------------ Protected Methods
+ // -------------------------------------------------------- Package Methods
/**
+ * Return the set of DTD URL registrations, keyed by public identifier.
+ */
+ Map getRegistrations() {
+
+ return (dtds);
+
+ }
+
+
+ /**
* Return the set of rules that apply to the specified match position.
* The selected rules are those that match exactly, or those rules
* that specify a suffix match and the tail of the rule matches the
@@ -1173,7 +1184,7 @@
*
* @param match The current match position
*/
- protected List getRules(String match) {
+ List getRules(String match) {
List rulesList = (List) this.rules.get(match);
if (rulesList == null) {