Skip to content

Commit

Permalink
Updated commit from Java.net 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuprabhakaran committed May 29, 2020
1 parent a0aac1e commit 0123ba2
Show file tree
Hide file tree
Showing 31 changed files with 771 additions and 1,128 deletions.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# JEazyProps
# **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.

> - http://www.roseindia.net/tutorial/java/core/files/filereadproperties.html
> - http://www.java2s.com/Tutorial/Java/0140__Collections/Usestoretosavetheproperties.htm
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.
12. Supports property file packed inside the jar to read.
13. On saving, Overrides the property inside jar by using an classpath property file.
14. File and Path selection option using filechooser With validation.
15. Integrable with the main application, and display as separate window.
16. Dual Mode Display (Read Mode and Read-Write Mode)
17. Supports the main application’s Look and feel.

### Steps to use JeazyPorps

1. Add the the jeazyprops dependency using maven
2.
75 changes: 75 additions & 0 deletions Release Notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
JeazyProps V 3.0
~~~~~~~~~~~~~~~~
Changed UI Integration Model
Separated the Reflection Layer
Added Support of Localization


JeazyProps V 2.1.2
~~~~~~~~~~~~~~~~~~
Added Date UI


JeazyProps V 2.1.1
~~~~~~~~~~~~~~~~~~
Fixed Group View Combobox
Fixed Progaurd Path
Added Release Notes to Release


JeazyProps V 2.1
~~~~~~~~~~~~~~~~~~
Added ScrollBar to View
Added Icon Image
Added Relative Path and Canaonical path Support
Added AboutBox
Fixed Display(Reset) on Third Pary Application
Fixed Encryption Error


JeazyProps V 2.0
~~~~~~~~~~~~~~~~~~
Added View Group Mode (Multiple Filters)
Added Combo box by using Enum Type
Added Reset Functionality to discard Changes

JeazyProps V 1.0.4
~~~~~~~~~~~~~~~~~~
Added View Mode and Editing Mode for Displaying Options
Added Mnemonic For Labels to Navigate with their Components
Fixed Display Name on Printing
Fixed Encryption Bugs
Text Field Focus Added

JeazyProps V 1.0.3
~~~~~~~~~~~~~~~~~~
Able to Integrate the with Application instead of using as Separate Console
Fixed bug on Encryption option for file paths
Enhanced for boolean data type to use default getter and setter
Enhanced Obfuscation


JeazyProps V 1.0.2
~~~~~~~~~~~~~~~~~~
Added File Selecting option for the file path options
Added validation for the file paths


JeazyProps V 1.0.1
~~~~~~~~~~~~~~~~~~
Supports file inside jar and External file using a single Method.
overrides the property inside jar by using an external property file while saving.


JeazyProps V 1.0.0
~~~~~~~~~~~~~~~~~~
Supports various data types such as String, Boolean, Integer and Double.
Supports Encryption such as Base64, Triple Des and AES by default.
Supports both XML and .properties file.
Supports both class path file (Inside Jar) 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.
127 changes: 126 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,61 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.prabhu</groupId>
<artifactId>JEazyProps</artifactId>
<version>1.0</version>
<version>1.0</version>
<packaging>jar</packaging>
<url>https://github.com/prabhuprabhakaran/JEazyProps</url>
<inceptionYear>2015</inceptionYear>

<organization>
<url>https://prabhuprabhakaran.info</url>
<name>prabhuprabhakaran</name>
</organization>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Prabhu Prabhakaran</name>
<email>[email protected]</email>
<organization>prabhuprabhakaran</organization>
<organizationUrl>https://prabhuprabhakaran.info</organizationUrl>
<timezone>UTC+05:30</timezone>
</developer>
</developers>

<scm>
<connection>https://github.com/prabhuprabhakaran/JEazyProps.git</connection>
<developerConnection>https://github.com/prabhuprabhakaran/JEazyProps.git</developerConnection>
<url>https://github.com/prabhuprabhakaran/JEazyProps</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url></url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url></url>
</repository>
</distributionManagement>

<issueManagement>
<system>Github</system>
<url>https://github.com/prabhuprabhakaran/JEazyProps/issues</url>
</issueManagement>

<!-- <ciManagement>
<system>Travis</system>
<url>https://travis-ci.org/dexecutor/dexecutor-core</url>
</ciManagement>-->

<dependencies>
<dependency>
<groupId>org.jdatepicker</groupId>
Expand All @@ -23,4 +76,76 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<localCheckout>true</localCheckout>
<pushChanges>false</pushChanges>
<mavenExecutorId>forked-path</mavenExecutorId>
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.11.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
*
* @author Prabhu Prabhakaran
*/
public final class Constants
{
public final class Constants {

static ResourceBundle rb;
public static String CharacterSetString = "UTF-8";
Expand Down Expand Up @@ -75,8 +74,7 @@ public final class Constants
public static String PropsCommentLine = "*******************************************************************************\n This Property file is generated by JeazyProps. Please do not edit it Manually.\n For More Info: http://prabhuprabhakaran.wordpress.com/2012/09/09/jeazyprops/\n http://java.net/projects/jeazyprops\n*******************************************************************************";
public static String XMLCommentLine = "\nThis Property file is generated by JeazyProps. Please do not edit it Manually.\n For More Info: http://prabhuprabhakaran.wordpress.com/2012/09/09/jeazyprops/\n http://java.net/projects/jeazyprops\n";

static
{
static {
rb = ResourceBundle.getBundle("Bundle", Locale.getDefault());
}

Expand All @@ -87,25 +85,22 @@ public final class Constants
*
* @return returns the value String found for the Key.
*/
public static String get(String pKeyValule)
{
public static String get(String pKeyValule) {
return rb.getString(pKeyValule);
}

/**
* Gets the Constant Value
*
* @param lPropsArg Replacement String to replace
* @param lPropsArg Replacement String to replace
* @param pKeyValule Key String to be find
*
* @return returns the modified String
*/
public static String get(String lPropsArg, String pKeyValule)
{
public static String get(String lPropsArg, String pKeyValule) {
int indexOf = Constants.get(pKeyValule).indexOf("<");
int indexOf1 = Constants.get(pKeyValule).indexOf(">");
if (indexOf != -1 && indexOf1 != -1)
{
if (indexOf != -1 && indexOf1 != -1) {
return Constants.get(pKeyValule).substring(0, indexOf) + lPropsArg + Constants.get(pKeyValule).substring(indexOf1 + 1);
}
return Constants.get(pKeyValule) + lPropsArg;
Expand Down
Loading

0 comments on commit 0123ba2

Please sign in to comment.