java method for json parsing