Firstly, thank you very much.
But, I do not think the method, toScript, is a perfect solution though it try to solve all types object tranferring from java object to json.
1. It uses iterator, also. Maybe iterative way cannot be substituted, that's OK.
2. It's the point. When the type is array, it will automatically add the quote sign:ret.append(','). It will reproduce the issue.
So, I hope the better way.