View Javadoc

1   /*
2    * $Id: CallMethodOnIndexRule.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.config.builders;
12  
13  import org.apache.commons.digester.CallMethodRule;
14  
15  /**
16   * todo document
17   * 
18   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
19   * @version $Revision: 7976 $
20   */
21  public class CallMethodOnIndexRule extends CallMethodRule
22  {
23      int index = 0;
24  
25      public CallMethodOnIndexRule(String s, int i, int index)
26      {
27          super(s, i);
28          this.index = index;
29      }
30  
31      public CallMethodOnIndexRule(String s, int index)
32      {
33          super(s);
34          this.index = index;
35      }
36  
37      public void end(String string, String string1) throws Exception
38      {
39          Object o = digester.peek(index);
40          digester.push(o);
41          super.end(string, string1);
42          o = digester.pop();
43      }
44  
45  }