zoukankan      html  css  js  c++  java
  • jsonpath

    1. java 类库

         jayway/JsonPath 

          maven 使用方法

    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.2.0</version>
    </dependency>
    

      jsonpath 语法:

          

    Operators

    OperatorDescription
    $ The root element to query. This starts all path expressions.
    @ The current node being processed by a filter predicate.
    * Wildcard. Available anywhere a name or numeric are required.
    .. Deep scan. Available anywhere a name is required.
    .<name> Dot-notated child
    ['<name>' (, '<name>')] Bracket-notated child or children
    [<number> (, <number>)] Array index or indexes
    [start:end] Array slice operator
    [?(<expression>)] Filter expression. Expression must evaluate to a boolean value.

    2. js 类库

          jsonpath-plus  

          npm    

          

    npm install jsonpath-plus
    

       使用 nodeJs  broswer

       

     var JSONPath = require('jsonpath-plus');
      var result = JSONPath({json: obj, path: path});
    

      

    <script src="lib/jsonpath.js"></script> 
      <script>
          var result = JSONPath({path: path, json: obj});
      </script> 
    

      

      

        

  • 相关阅读:
    java的枚举
    java解析XML的三种方法
    java静态代理
    java注释
    Jquery基础之DOM操作
    sql点滴43—mysql允许用户远程登陆
    js实现复制功能
    MVC ViewData和ViewBag
    Visual Studio 2013 Web开发新特性
    VisualStudio2013快捷键
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/5938491.html
Copyright © 2011-2022 走看看