4 Comments

JeazyProps

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.

Features

  1. Reduces complexity and LOC of codes to load number of properties.
  2. Supports various data types such as String, Boolean, Integer and Double.
  3. Supports Encryption such as Base64, TripleDes and AES by default.
  4. Supports both XML and .properties file.
  5. Supports both class path file and external file.
  6. Supports different GUI components dynamically as per the data type.
  7. Supports Validation of data.
  8. Supports user defined Encryption Algorithms.
  9. Zero lines code to Update and Save the properties on run time.
  10. Well Designed and completely documented using javadoc.
  11. Additional functionality of displaying properties in command window.

Steps to use JeazyPorps

1. Download the JeazyProps jar and Java-doc from the Website

http://java.net/projects/jeazyprops/downloads

2. Add the jar to the project.
In Netbeans, Right click on Libraries and click Add Jar/Folder.
Browse and add the jar to the Project.

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.

The POJO/Bean is created as the below…

we may add a singleton wrapper also with the class as below

we may simply use the properties in the Application as
PropsTestGUI.getInstance().getProperty1();

We may configure the properties using the GUI,
the GUI invoked by calling the function
PropsTestGUI.getInstance().displayProperties();

This slideshow requires JavaScript.

Advertisements

4 comments on “JeazyProps

  1. This article provide many tips. Very useful to me. Thanks a lot ?

  2. it is better for more actions.
    i understand somthing.
    i want to learn this type.
    thanks anna

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s