Unless you’ve been living under a rock for the last months and years, you’ve probably heard about the efforts for adding a module system to the Java platform, code-named "Project Jigsaw".
Defining a module system and modularizing a huge system like the JDK is by no means a trivial task, so it’s not by surprise that the advent of Jigsaw has been delayed several times.
But I think by now it’s a rather safe bet to expect Jigsaw to be released as part of JDK 9 eventually (the exact release date remains to be defined), especially since it became part of the early access builds a while ago.
This means that if you are an author of a library or framework, you should grab the latest JDK preview build and make sure your lib can be used a) on Java 9 and b) within modularized applications using Jigsaw.
One of the things library developers often miss in Java are property literals.
In this post I’m going to show how to make creative use of Java 8 method references to emulate property literals, with the help of some byte code generation.
Akin to class literals (e.g. Customer.class), property literals would allow to refer to the properties of a bean class in a type-safe manner.
This would be useful for designing APIs that run actions on specific bean properties or apply some means of configuration to them.
E.g. consider the API for programmatic configuration of index mappings in Hibernate Search: