You can use Checkstyle to implement "customized checks". See it to learn more:
http://saturnnetwork.wordpress.com/2012/11/26/ultimate-architecture-enforcement-prevent-code-violations-at-code-commit-time/
I did not try it myself but I think it is not difficult to implement and it's free.