JeazyProps is a java framework, that used to load the properties dynamically into a POJO.
Properties is a subclass of Hashtable. It is used to maintain lists of values in which the key is a String and the value is also a String. The Properties class is used by many other Java classes. For example, it is the type of object returned by System.getProperties() when obtaining environmental values.
To load an external resource in Java, several options immediately come to mind: files, classpath resources, and URLs.
- load()- This method reads a property list (key and element pairs) from the input stream.
- getProperty() – This method searches for the property with the specified key in the properties file.
- store() – This methods writes the properties list to the output steam.
Here i have listed some classic example for loading and saving the properties by using java.
By using these snippets we can able to load manually, i.e, the mapping of the properties to the POJO bean should always code by us. There should be no option to change the properties using any GUI. If we want a UI then we have to build that separately to change the properties.
But in case of JeazyProps, It Automatically draws the GUI to save the properties to the file, either as XML or as .properties file. It reduces the effort for loading the properties from file, assigning to the bean and writing the properties to the file.
- Reduces complexity and LOC of codes to load number of properties.
- Supports various data types such as String, Boolean, Integer and Double.
- Supports Encryption such as Base64, TripleDes and AES by default.
- Supports both XML and .properties file.
- Supports both class path file and external file.
- Supports different GUI components dynamically as per the data type.
- Supports Validation of data.
- Supports user defined Encryption Algorithms.
- Zero lines code to Update and Save the properties on run time.
- Well Designed and completely documented using javadoc.
- Additional functionality of displaying properties in command window.
Steps to use JeazyPorps
1. Download the JeazyProps jar and Java-doc from the Website
3. Create Empty pojo class. Create getter and setter for your properties.
4. Create objects for keyvalue class as exact name as pojo member variable with initcaps.
we may simply use the properties in the Application as
We may configure the properties using the GUI,
the GUI invoked by calling the function