public Inspector inspect() {
        if (value == null) {
            JsonDecoder decoder = new JsonDecoder();
            Slime slime = decoder.decode(new Slime(), Utf8.toBytes(content));
            if (slime.get().field("error_message").valid() &&
                slime.get().field("partial_result").valid() &&
                slime.get().field("offending_input").valid())
            {
                // probably a json parse error...
                value = new Value.StringValue(content);
            } else if (slime.get().type() == com.yahoo.slime.Type.OBJECT ||
                       slime.get().type() == com.yahoo.slime.Type.ARRAY)
            {
                // valid json object or array
                value = new SlimeAdapter(slime.get());
            } else {
                // 'valid' json, but leaf value
                value = new Value.StringValue(content);
            }
        }
        return value;
    }
A JSON wrapper. Contains XML-style rendering of a JSON structure.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/prelude/hitfield/JSONString.java