com.jayway.jsonpath.Configuration.setEvaluationListeners()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.jayway.jsonpath.Configuration.setEvaluationListeners()方法的一些代码示例,展示了Configuration.setEvaluationListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.setEvaluationListeners()方法的具体详情如下:
包路径:com.jayway.jsonpath.Configuration
类名称:Configuration
方法名:setEvaluationListeners

Configuration.setEvaluationListeners介绍

[英]Creates a new Configuration with the provided evaluation listeners
[中]使用提供的评估侦听器创建新配置

代码示例

代码示例来源:origin: json-path/JsonPath

@Override
public ReadContext withListeners(EvaluationListener... listener) {
  return new JsonContext(json, configuration.setEvaluationListeners(listener));
}

代码示例来源:origin: json-path/JsonPath

@Test
  public void evaluation_listeners_can_be_cleared() {

    EvaluationListener listener = new EvaluationListener() {
      @Override
      public EvaluationContinuation resultFound(FoundResult found) {
        return EvaluationContinuation.CONTINUE;
      }
    };

    Configuration configuration1 = Configuration.builder().evaluationListener(listener).build();
    Configuration configuration2 = configuration1.setEvaluationListeners();

    assertThat(configuration1.getEvaluationListeners()).hasSize(1);
    assertThat(configuration2.getEvaluationListeners()).hasSize(0);
  }
}

代码示例来源:origin: com.jayway.jsonpath/json-path

public ReadContext withListeners(EvaluationListener... listener){
  return new JsonContext(json, configuration.setEvaluationListeners(listener));
}

代码示例来源:origin: com.github.lafa.jsonpath/json-path

@Override
public ReadContext withListeners(EvaluationListener... listener){
  return new JsonContext(json, configuration.setEvaluationListeners(listener));
}

相关文章