Contents
1. What is it?
2. Advantages
3. Where to get it?
4. Requirements
5. Samples
6. Security Concern
7. Release Notes
8. Licensing and Legal Issues
9. Useful Links
1. What is it?
Java Configuration Helper Class is simple and effective way to make your application configurable.
It is based on Java Reflection and was created to make the configuration functionality simple, intuitive and yet functional.
2. Advantages
Simple:
Using Java Configuration Helper Class you don't need to do anything more then define
which configurable fields (variables) you need and extend your configuration class from the com.softcorporation.utils.Configuration.
Ah yes, one more: put values in the configuration file. This is it - you are done.
No pain with getter(), setter() methods and arrays, vectors, sets, lists are created for you automatically.
If you have ever worked with other configuration supporting tools (like Digester) you would agree - this is much, much less work!
Fast and secure access to configurable values:
The configuration loaded only once and all values are converted from Strings to real values.
You can define configuration fields as a public and access them directly. What can be faster?
Another option is to define them as protected and access from extending class.
And finally, of course, you can define configuration fields as private and access them using getter() method.
Small:
The configuration class is very small and can be even reduced in size if there is need for it
(You can remove Logger, Arguments, etc...)
Functional:
You can configure all primitive Java types, as well as arrays, vectors, sets and lists.
(ATTENTION: String arrays have some limitations, which may require additional coding).
You can load the configuration from a file or from the classpath. You can save it to a file.
And you can use any Java supported encoding for the configuration file, for example, UTF-8.
In addition you will have some useful functions to process Strings, read arguments from the command line, have basic logging
(which you can easily replace with your favorite Logger) and read OS variables.
Source code attached:
Full source code is provided for your convenience.
Free:
If you like it - use free of charge. But please read below "Legal and licensing issues".
3. Where to get it?
The home page for the Java Configuration Helper Class can be found on the SoftCorporation LLC.
web site http://www.softcorporation.com/products/configuration.
There you also can find information on how to download the latest release as
well as all other information you might need regarding this project.
Click here to Download Java Configuration Helper.
4. Requirements
o A Java 1.2 or later compatible virtual machine for your operating system.
5. Samples
Java code samples are included in the download package. Click on a link for more information on How to use Java Configuration Helper.
6. Security Concern
Original version of this library (ver. 1.0.0) had one significant limitation: usage of public fields only.
After receiving some complaints we published version without this limitation,
however you still can use public fields to avoid necessity to make getter() methods.
You can verify if there is any loss in security looking at the code, which you would have using setter methods.
If the setter methods are public and have no protection to change underlying values - there is no difference in code safety.
Good (or bad?) news is - pretty often there is no difference. Also in case if you need to protect some fields you can do it within initialize() method.
See more on Java Secure Coding at http://java.sun.com/security/seccodeguide.html.
7. Release Notes
Keywords: SoftCorporation LLC., Java, API, classes, free, software, configuration, tool, component, download, application