Java gets some Properties.

robbyoconnor's picture

There is a proposal to add properties to java. Properties will eliminate the need for getters/setters in the usual javabeans pattern style. I’m sure you wanna see some code examples, so as usual, i’ll give you the way it’s done currently, in this case following the JavaBeans spec of specifying a getter/setter. To run this code you’ll need to go and check out the prototype compiler from the subversion repository at java.net. You will need to register. After you have done that type:
svn checkout https://kijaro.dev.java.net/svn/kijaro/branches/properties kijaro --username username --password yourpassword
replace username and yourpassword with the username and password you registered with.

Apache Ant is required to build the compiler.

Now to compile it (instructions are for users running linux;
if running windows i assume you know your OS properly to adjust this).
1) type cd kijaro/langtools/make
2) type ant -Dboot.java.home=$JAVA_HOME
3) now to compile the code you’ll do /path/to/kijaro/bin/kijaro-javac /path/to/ClassName.java setting your classpath as needed.
4) To run this, you can either use /path/to/kijaro/bin/kijaro-java /path/to/ClassName or you can use your installed JRE and do: java /path/to/ClassName

That’s all you need to know to run this code. Questions? email me.

Organization: OpenMRS Original: Source