字符串查询对json数据进行验证

时间:2019-02-24 13:40:44

标签: java json

Map<String, Object> data = new HashMap<>()        
data.put("Description","laks");
data.put("EntityName","Pub");
data.put("Severity","Critical");

String query = "Severity = Critical AND (EntityName contains P OR 
EntityName contains p )";

在上面的示例代码中,我想对示例json对象“ data”应用/验证“ query”字符串。有没有可以帮助我的示例代码。在上面的示例数据和查询中,它应该返回false吗?

1 个答案:

答案 0 :(得分:0)

您似乎需要此库: https://github.com/json-path/JsonPath