KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > config > SettingConfigurator


1 /*
2  * SettingConfigurator.java
3  *
4  * Created on 29. August 2003, 21:49
5  */

6
7 package org.contineo.core.config;
8
9 import org.contineo.core.XMLBean;
10 /**
11  * This class processes the file settings.xml.
12  * @author Michael Scholz
13  * @version 1.0
14  */

15 public class SettingConfigurator {
16
17     /**
18      *
19      * @uml.property name="xml"
20      * @uml.associationEnd
21      * @uml.property name="xml" multiplicity="(1 1)"
22      */

23     private XMLBean xml;
24
25     
26     /** Creates a new instance of SettingConfigurator */
27     public SettingConfigurator() {
28         ClassLoader JavaDoc loader = Thread.currentThread().getContextClassLoader();
29         xml = new XMLBean(loader.getResource("settings.xml"));
30     }
31
32     /**
33      * This method finds an option by a given name.
34      * @param name Name of the option.
35      */

36     public String JavaDoc getValue(String JavaDoc name) {
37         return xml.getText("setting", "name", name);
38     }
39 }
40
Popular Tags