this patch contains a bug fix and an enhancement.
(bug fix) the addFactoryCreate method now sets the digester property
(enhancement) i've added a property which gives public visibility to the
name of the xml element currently being processed.
Index: digester/src/java/org/apache/commons/digester/Digester.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
retrieving revision 1.27
diff -u -r1.27 Digester.java
--- digester/src/java/org/apache/commons/digester/Digester.java 2001/11/14 20:42:04
1.27
+++ digester/src/java/org/apache/commons/digester/Digester.java 2001/11/18 18:48:48
@@ -641,8 +641,21 @@
useContextClassLoader = use;
- }
+ }
+
+ /**
+ * This property gives the name of the xml element currently being processed.
+ */
+ public String getCurrentElementName() {
+
+ String elementName = match;
+ int lastSlash = elementName.lastIndexOf('/');
+ if (lastSlash >= 0)
+ elementName = elementName.substring(lastSlash+1);
+ return elementName;
+
+ }
// ------------------------------------------------- ContentHandler Methods
@@ -1459,6 +1472,7 @@
public void addFactoryCreate(String pattern,
ObjectCreationFactory creationFactory) {
+ creationFactory.setDigester(this);
addRule(pattern,
new FactoryCreateRule(this, creationFactory));
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>