sanders 01/05/12 10:25:57
Modified: digester/src/java/org/apache/commons/digester
CallMethodRule.java CallParamRule.java
Digester.java ObjectCreateRule.java Rule.java
SetNextRule.java SetPropertiesRule.java
SetPropertyRule.java SetTopRule.java
Log:
Updated to SAX2 interfaces to remove deprecation warnings.
Revision Changes Path
1.2 +6 -6
jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java
Index: CallMethodRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CallMethodRule.java 2001/05/03 00:28:33 1.1
+++ CallMethodRule.java 2001/05/12 17:25:52 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
1.2 2001/05/12 17:25:52 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:52 $
*
* ====================================================================
*
@@ -65,7 +65,7 @@
import java.lang.reflect.Method;
import java.lang.ClassLoader;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
import org.apache.commons.beanutils.ConvertUtils;
@@ -77,7 +77,7 @@
*
* @author Craig McClanahan
* @author Scott Sanders
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:52 $
*/
public class CallMethodRule extends Rule {
@@ -218,7 +218,7 @@
*
* @param attributes The attribute list for this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
// Push an array to capture the parameter values if necessary
if (paramCount > 0) {
1.2 +5 -5
jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java
Index: CallParamRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CallParamRule.java 2001/05/03 00:28:33 1.1
+++ CallParamRule.java 2001/05/12 17:25:53 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java,v
1.2 2001/05/12 17:25:53 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:53 $
*
* ====================================================================
*
@@ -64,7 +64,7 @@
import java.lang.reflect.Method;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
/**
@@ -73,7 +73,7 @@
* by a surrounding CallMethodRule rule.
*
* @author Craig McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:53 $
*/
public class CallParamRule extends Rule {
@@ -143,7 +143,7 @@
*
* @param attributes The attribute list for this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
if (attributeName != null)
bodyText = attributes.getValue(attributeName);
1.2 +30 -18
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Digester.java 2001/05/03 00:28:33 1.1
+++ Digester.java 2001/05/12 17:25:53 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $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 $
*
* ====================================================================
*
@@ -76,11 +76,11 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.apache.commons.collections.ArrayStack;
-import org.xml.sax.AttributeList;
-import org.xml.sax.DocumentHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
-import org.xml.sax.HandlerBase;
+import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
@@ -103,10 +103,10 @@
* even from the same thread.</p>
*
* @author Craig McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:53 $
*/
-public class Digester extends HandlerBase {
+public class Digester extends DefaultHandler {
// --------------------------------------------------------- Constructors
@@ -408,11 +408,17 @@
/**
* Process notification of the end of an XML element being reached.
*
- * @param name Name of the element that is ending
- *
+ * @param uri - The Namespace URI, or the empty string if the
+ * element has no Namespace URI or if Namespace processing is not
+ * being performed.
+ * @param localName - The local name (without prefix), or the empty
+ * string if Namespace processing is not being performed.
+ * @param qName - The qualified XML 1.0 name (with prefix), or the
+ * empty string if qualified names are not available.
* @exception SAXException if a parsing error is to be reported
*/
- public void endElement(String name) throws SAXException {
+ public void endElement(String namespaceURI, String localName,
+ String qName) throws SAXException {
// if (debug >= 3)
// log("endElement(" + match + ")");
@@ -532,14 +538,20 @@
/**
* Process notification of the start of an XML element being reached.
- *
- * @param name Name of the element that is starting
- * @param list The attributes associated with this element
*
+ * @param uri The Namespace URI, or the empty string if the element
+ * has no Namespace URI or if Namespace processing is not being performed.
+ * @param localName The local name (without prefix), or the empty
+ * string if Namespace processing is not being performed.
+ * @param qName The qualified name (with prefix), or the empty
+ * string if qualified names are not available.\
+ * @param list The attributes attached to the element. If there are
+ * no attributes, it shall be an empty Attributes object.
* @exception SAXException if a parsing error is to be reported
*/
- public void startElement(String name, AttributeList list)
- throws SAXException {
+ public void startElement(String namespaceURI, String localName,
+ String qName, Attributes list)
+ throws SAXException {
// Save the body text accumulated for our surrounding element
bodyTexts.push(bodyText);
@@ -547,9 +559,9 @@
// Compute the current matching rule
if (match.length() > 0)
- match += "/" + name;
+ match += "/" + localName;
else
- match = name;
+ match = localName;
// if (debug >= 3)
// log("startElement(" + match + ")");
1.2 +6 -6
jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java
Index: ObjectCreateRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ObjectCreateRule.java 2001/05/03 00:28:33 1.1
+++ ObjectCreateRule.java 2001/05/12 17:25:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
1.2 2001/05/12 17:25:54 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:54 $
*
* ====================================================================
*
@@ -64,7 +64,7 @@
import java.lang.ClassLoader;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
/**
@@ -74,7 +74,7 @@
*
* @author Craig McClanahan
* @author Scott Sanders
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:54 $
*/
public class ObjectCreateRule extends Rule {
@@ -138,7 +138,7 @@
*
* @param attributes The attribute list of this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
// Identify the name of the class to instantiate
String realClassName = className;
1.2 +5 -5
jakarta-commons/digester/src/java/org/apache/commons/digester/Rule.java
Index: Rule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Rule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Rule.java 2001/05/03 00:28:33 1.1
+++ Rule.java 2001/05/12 17:25:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Rule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Rule.java,v
1.2 2001/05/12 17:25:54 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:54 $
*
* ====================================================================
*
@@ -63,7 +63,7 @@
package org.apache.commons.digester;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
/**
@@ -71,7 +71,7 @@
* a corresponding nested pattern of XML elements has been matched.
*
* @author Craig McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:54 $
*/
public abstract class Rule {
@@ -111,7 +111,7 @@
*
* @param attributes The attribute list of this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
; // The default implementation does nothing
1.2 +5 -5
jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java
Index: SetNextRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SetNextRule.java 2001/05/03 00:28:33 1.1
+++ SetNextRule.java 2001/05/12 17:25:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v
1.2 2001/05/12 17:25:54 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:54 $
*
* ====================================================================
*
@@ -65,7 +65,7 @@
import java.lang.ClassLoader;
import java.lang.reflect.Method;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
/**
@@ -75,7 +75,7 @@
*
* @author Craig McClanahan
* @author Scott Sanders
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:54 $
*/
public class SetNextRule extends Rule {
1.2 +7 -7
jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java
Index: SetPropertiesRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SetPropertiesRule.java 2001/05/03 00:28:33 1.1
+++ SetPropertiesRule.java 2001/05/12 17:25:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v
1.2 2001/05/12 17:25:54 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:54 $
*
* ====================================================================
*
@@ -64,7 +64,7 @@
import java.util.HashMap;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
import org.apache.commons.beanutils.BeanUtils;
@@ -73,7 +73,7 @@
* stack, based on attributes with corresponding names.
*
* @author Craig McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:54 $
*/
public class SetPropertiesRule extends Rule {
@@ -103,12 +103,12 @@
* @param context The associated context
* @param attributes The attribute list of this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
// Build a set of attribute names and corresponding values
HashMap values = new HashMap();
for (int i = 0; i < attributes.getLength(); i++) {
- String name = attributes.getName(i);
+ String name = attributes.getLocalName(i);
String value = attributes.getValue(i);
values.put(name, value);
}
1.2 +7 -7
jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java
Index: SetPropertyRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SetPropertyRule.java 2001/05/03 00:28:33 1.1
+++ SetPropertyRule.java 2001/05/12 17:25:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v
1.2 2001/05/12 17:25:54 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:54 $
*
* ====================================================================
*
@@ -64,7 +64,7 @@
import java.util.HashMap;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
import org.apache.commons.beanutils.BeanUtils;
@@ -73,7 +73,7 @@
* top of the stack, based on attributes with specified names.
*
* @author Craig McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:54 $
*/
public class SetPropertyRule extends Rule {
@@ -125,14 +125,14 @@
* @param context The associated context
* @param attributes The attribute list of this element
*/
- public void begin(AttributeList attributes) throws Exception {
+ public void begin(Attributes attributes) throws Exception {
// Identify the actual property name and value to be used
String actualName = null;
String actualValue = null;
HashMap values = new HashMap();
for (int i = 0; i < attributes.getLength(); i++) {
- String name = attributes.getName(i);
+ String name = attributes.getLocalName(i);
String value = attributes.getValue(i);
if (name.equals(this.name))
actualName = value;
1.2 +5 -5
jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java
Index: SetTopRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SetTopRule.java 2001/05/03 00:28:33 1.1
+++ SetTopRule.java 2001/05/12 17:25:55 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v
1.1 2001/05/03 00:28:33 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/03 00:28:33 $
+ * $Header:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v
1.2 2001/05/12 17:25:55 sanders Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/05/12 17:25:55 $
*
* ====================================================================
*
@@ -65,7 +65,7 @@
import java.lang.ClassLoader;
import java.lang.reflect.Method;
-import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
/**
@@ -74,7 +74,7 @@
*
* @author Craig McClanahan
* @author Scott Sanders
- * @version $Revision: 1.1 $ $Date: 2001/05/03 00:28:33 $
+ * @version $Revision: 1.2 $ $Date: 2001/05/12 17:25:55 $
*/
public class SetTopRule extends Rule {