[ja] Follow bc3be19a, add afterValidate, code layout change.

[ja] following changes
* Follow bc3be19a50d5829831cc9adfc3e935a7a5119791
* Add missing `afterValidate` 
* Change sample code layout (add return code to long line)