propjavac

A Java Compiler with built-in support for Java properties

Tired of Typing Getters and Setters?

The Java property feature removes the drudgery of typing the code and documentation for property getters and setters and makes the code dramatically easier to read.

 

 

BEFORE:

 

private String name;

public String getName() {

           return this.name

}
public void setName(String name) {

           this.name = name

}

AFTER:

 

@Property

private String name;

 

Because properties become a built-in feature of the Java language, the compiler can do additional checking.

What is needed to use this?

To use Java properties you need to:

1. Download Mustang (JDK 6.0)

2. Download propjavac.jar

3. Either use the provided command line scripts and ant tasks, or just modify javac’s bootpath to include propjavac.jar

 

That is it! The Java properties compiled classes are standard and work in any JVM.

 

COMMAND LINE:

 

$PROPJAVA_HOME/bin/propjavac                 Student.java

$JAVA_HOME/bin/java Student

ANT BUILD:

 

<target name="compile">  

                <propjavac

                                srcdir="${basedir}"

                                includes="Student.java" />

</target>

1