On Fri, Nov 20, 2009 at 1:25 PM, Niclas Hedhman <[email protected]> wrote:

> JSON string is stored into the Node, and when it is retrieved the
> isPrimitiveType will see it as a String and not as a JSON value.
> Looking into how to solve it.

Sorry, wasn't isPrimitive() but the propertyType.type().isString()
resolving to true for a ValueComposite.

Since, I obviously don't understand that ValueType system, I would
like to have this either explained formally. Questions;

1. What is isXyz() supposed to be used for?

2. Why is Date/Enum/Value and others isString()?

3. When how is it supposed to be used?


Is it correct (by trying it works) to remove the if() statement...

    if ( propertyType.type().isString() )
    {
        return prop;
    }
    else
    {
        String json = "[" + prop + "]";
        JSONTokener tokener = new JSONTokener( json );
        JSONArray array = (JSONArray) tokener.nextValue();

and just let the json deserialization happen anyway???


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to