JSONUtil 1.3 released

JSONUtil 1.3 has been released. Get it here

This release adds two new configuration options for encoding java.util.Date objects.

Date objects can be encoded as ISO 8601 extended format strings. These can be handed directly to the new Date(String) constructor in Javascript in modern implementations of Javascript.

Date objects can alternatively be encoded as a call to the new Date(String) constructor. This is non-standard JSON and while it works in Javascript eval(), it probably won’t work in most JSON parsers other than the one in JSONUtil.

The options for these both default to false. Setting one of them to true forces the other one to false.

If the JSONConfig sent to the JSON parser has either option enabled, then the parser will try to detect if a string is actually a date and if so, will return a Date object instead of a String.

The stack used for loop detection has been moved out of the JSONConfig object. This makes JSONConfig objects thread safe unless you use custom number formats, since the formats are not themselves thread safe.