ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Heath <doo...@brainfood.com>
Subject Re: svn commit: r908713 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion: CollectionConverters.java test/MiscTests.java
Date Thu, 11 Feb 2010 21:54:20 GMT
Adrian Crum wrote:
> Adam Heath wrote:
>> ObjectToJSONString, and JSONStringToObject, is fairly straight forward
>> to implement.  However, I still need to do my 'resolve' feature.
>> Possibily an ObjectToJSONResolveString, or some such.
> 
> What does the resolve feature do?
> 

JSON only supports String, booleans, numbers(Long or Double),
arrays(List), and object(Map).

The resolve feature extends that, by parsing this pattern:

resolve("java.net.URL:http:\/\/ofbiz.apache.org")

That becomes a raw token in the markup.  It allows me to embed any
other object that has a String representation into a json output
string.  I don't want to have to write separate ToJSONString
converters for *every* non-standard object, I'd like to have just one.
 But, to do that, I have to be able to get a bi-directional string
representation of whatever object.  Calling .toString in such cases
doesn't work(which is what your original ListToString converter did).

Mime
View raw message