Revision 47763
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/main/java/org/gvsig/fmap/dal/store/h2/functions/Json_value.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.gvsig.json.Json; |
26 | 26 |
import org.gvsig.json.JsonPathContext; |
27 |
import org.gvsig.json.PathNotFoundException; |
|
27 | 28 |
|
28 | 29 |
/** |
29 | 30 |
* |
... | ... | |
36 | 37 |
} |
37 | 38 |
|
38 | 39 |
public static Object json_value(String json, String path) { |
39 |
JsonPathContext context = Json.createJsonPathContext(json); |
|
40 |
Object result = context.get(path); |
|
41 |
return result; |
|
40 |
try { |
|
41 |
JsonPathContext context = Json.createJsonPathContext(json); |
|
42 |
Object result = context.get(path); |
|
43 |
return result; |
|
44 |
} catch (PathNotFoundException ex) { |
|
45 |
return null; |
|
46 |
} |
|
42 | 47 |
} |
43 | 48 |
} |
Also available in: Unified diff