Add "constants generation" to common.py and java bindings/doc