View Javadoc

1   /*
2    * $Id: CallMethodOnIndexRule.java 7963 2007-08-21 08:53:15Z 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  public class CallMethodOnIndexRule extends CallMethodRule
19  {
20      int index = 0;
21  
22      public CallMethodOnIndexRule(String s, int i, int index)
23      {
24          super(s, i);
25          this.index = index;
26      }
27  
28      public CallMethodOnIndexRule(String s, int index)
29      {
30          super(s);
31          this.index = index;
32      }
33  
34      public void end(String string, String string1) throws Exception
35      {
36          Object o = digester.peek(index);
37          digester.push(o);
38          super.end(string, string1);
39          o = digester.pop();
40      }
41  
42  }