KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > config > builders > MuleSetPropertiesRule


1 /*
2  * $Id: MuleSetPropertiesRule.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
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.SetPropertiesRule;
14 import org.xml.sax.Attributes JavaDoc;
15
16 /**
17  * this rule Allows for template parameters to be parse on the configuration file
18  * attributes in the form of ${param-name}. These will get resolved against
19  * properties set in the mule-properites element
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24 public class MuleSetPropertiesRule extends SetPropertiesRule
25 {
26     protected PlaceholderProcessor processor;
27
28     public MuleSetPropertiesRule()
29     {
30         processor = new PlaceholderProcessor();
31     }
32
33     public MuleSetPropertiesRule(PlaceholderProcessor processor)
34     {
35         this.processor = processor;
36     }
37
38     public MuleSetPropertiesRule(String JavaDoc[] strings, String JavaDoc[] strings1)
39     {
40         super(strings, strings1);
41         processor = new PlaceholderProcessor();
42     }
43
44     public MuleSetPropertiesRule(String JavaDoc[] strings, String JavaDoc[] strings1, PlaceholderProcessor processor)
45     {
46         super(strings, strings1);
47         this.processor = processor;
48     }
49
50     public void begin(String JavaDoc s1, String JavaDoc s2, Attributes JavaDoc attributes) throws Exception JavaDoc
51     {
52         attributes = processor.processAttributes(attributes, s2);
53         super.begin(attributes);
54     }
55 }
56
Popular Tags