java應用程序的配置管理類庫,Commons Configuration 2.0-beta1 發布
Commons Configuration 是一個java應用程序的配置管理類庫。可以從properties或者xml文件中加載軟件的配置信息,用來構建支撐軟件運 行的基礎環境。在一些配置文件較多較的復雜的情況下,使用該配置工具比較可以簡化配置文件的解析和管理。也提高了開發效率和軟件的可維護性。
下面是一個加載 properties 配置文件的代碼:
CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new PropertiesConfiguration("oschina.properties"));
String usernaem = config.getString("username");
String password = config.getString("password");
Commons Configuration 2.0 版本最主要的是重新設計 Configuration API。
完整改進請看:http://www.apache.org/dist/commons/configuration/RELEASE-NOTES.txt
1.x 用戶升級說明:http://commons.apache.org/configuration/userguide/upgradeto2_0.html
源代碼和二進制包下載:
http://commons.apache.org/proper/commons-configuration/download_configuration.cgi
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!