- 0 - if it is a Number or primitive number
- '' - if it is a String/Character or char
- false - if it is a Boolean
- null - all other cases
DefaultValueProcessor
is now available, along with DefaultValueProcessorMatcher
(for the same reasons shown here).The second feature caught me by surprise as I didn't understand the usefulness of it at first sight, the thing is that a user has a bean which uses a composed Map for its property representation, but that bean does not implements Map nor it is a DynaBean, so he would like to call internalMap.put() instead of going to trough the usual
PropertyUtils.setProperty()
, which depending on the client code can be sometimes a performance bottleneck. After a quick message exchange and a prompt patch PropertySetStrategy
is ready.These features have a default implementation already plugged into JsonConfig, which is the place where you would also plug-in your custom implementations.
The third one is related to JSON <-> serialization. As you may probably know, XMLSerializer will output type hints (unless configured otherwise) to an XML string, using those hints again when transforming back to JSON. The hints use reserved keywords as attributes [type,class,params,null] but it may be the case for some users that some of those keywords must have business meaning instead of just 'framework' meaning, how do we cope with that? by adding a 'json_' prefix to the reserved keywords. In order to maintain backward compatibility there is a flag on XMLSerializer (typeHintsCompatibility) that when set to
false
will enable the prefix, when true it will disregard it.The code is already on the cvs along with a couple of quick bug fixes. Keep posted for more Json-lib updates.