You can download, LGPL, a Pattern Enforcing Compiler (PEC(TM)) from:

http://pec.dev.java.net

The compiler is easy to use, e.g. add implements Singleton to a class definition to have the Singleton pattern enforced.

You can also write your own patterns and have the compiler enforce these.