commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester Digester.java
Date Sun, 18 Nov 2001 21:53:24 GMT
craigmcc    01/11/18 13:53:24

  Modified:    digester/src/java/org/apache/commons/digester Digester.java
  Log:
  Expose the name of the current element being processed.  Make sure that
  the FactoryCreateRule which is passed a factory instance knows what
  digester it belongs to.
  
  Submitted by:	Robert Burrell Donkin <robertdonkin@mac.com>
  
  Revision  Changes    Path
  1.28      +19 -4     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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Digester.java	2001/11/14 20:42:04	1.27
  +++ Digester.java	2001/11/18 21:53:24	1.28
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.27 2001/11/14 20:42:04 craigmcc Exp $
  - * $Revision: 1.27 $
  - * $Date: 2001/11/14 20:42:04 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.28 2001/11/18 21:53:24 craigmcc Exp $
  + * $Revision: 1.28 $
  + * $Date: 2001/11/18 21:53:24 $
    *
    * ====================================================================
    *
  @@ -108,7 +108,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.27 $ $Date: 2001/11/14 20:42:04 $
  + * @version $Revision: 1.28 $ $Date: 2001/11/18 21:53:24 $
    */
   
   public class Digester extends DefaultHandler {
  @@ -386,6 +386,20 @@
   
   
       /**
  +     * Return the name of the XML element that is currently being processed.
  +     */
  +    public String getCurrentElementName() {
  +
  +        String elementName = match;
  +        int lastSlash = elementName.lastIndexOf('/');
  +        if (lastSlash >= 0)
  +            elementName = elementName.substring(lastSlash + 1);
  +        return (elementName);
  +
  +    }
  +
  +
  +    /**
        * Return the debugging detail level of this Digester.
        */
       public int getDebug() {
  @@ -1459,6 +1473,7 @@
       public void addFactoryCreate(String pattern,
                                    ObjectCreationFactory creationFactory) {
   
  +        creationFactory.setDigester(this);
           addRule(pattern,
                   new FactoryCreateRule(this, creationFactory));
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message