allow java library to create alert JSON rather than just alert string