Browse Source

Fixed naming issue with PassthroughFilter.java

pull/6/head
Kalle Stenflo 13 years ago
parent
commit
40c0814dfa
  1. 4
      json-path/src/main/java/com/jayway/jsonpath/reader/filter/FilterFactory.java
  2. 5
      json-path/src/main/java/com/jayway/jsonpath/reader/filter/PassthroughFilter.java
  3. 12
      json-path/src/test/java/com/jayway/jsonpath/ComplianceTests.java

4
json-path/src/main/java/com/jayway/jsonpath/reader/filter/FilterFactory.java

@ -8,8 +8,8 @@ package com.jayway.jsonpath.reader.filter;
*/
public class FilterFactory {
private final static Filter DOCUMENT_FILTER = new PassThroughFilter("$", false);
private final static Filter ALL_ARRAY_ITEMS_FILTER = new PassThroughFilter("[*]", true);
private final static Filter DOCUMENT_FILTER = new PassthroughFilter("$", false);
private final static Filter ALL_ARRAY_ITEMS_FILTER = new PassthroughFilter("[*]", true);
private final static Filter WILDCARD_FILTER = new WildcardFilter("*");
private final static Filter SCAN_FILTER = new ScanFilter("..");

5
json-path/src/main/java/com/jayway/jsonpath/reader/filter/PassthroughFilter.java

@ -8,11 +8,12 @@ import com.jayway.jsonpath.spi.JsonProvider;
* Date: 11/4/11
* Time: 10:15 PM
*/
public class PassThroughFilter extends Filter {
public class PassthroughFilter extends Filter {
private boolean isArrayFilter;
public PassThroughFilter(String condition, boolean isArrayFilter) {
public PassthroughFilter(String condition, boolean isArrayFilter) {
super(condition);
this.isArrayFilter = isArrayFilter;
}

12
json-path/src/test/java/com/jayway/jsonpath/ComplianceTests.java

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;
/**
@ -113,14 +114,11 @@ public class ComplianceTests {
" }";
//assertThat(JsonPath.<List<String>>read(json, "$.menu.items[?(@ && @.id && !@.label)].id"), hasItems("?")); //low
//assertThat(JsonPath.<List<String>>read(json, "$.menu.items[?(@ && @.label && /SVG/.test(@.label))].id"), hasItems("?")); //low
//assertThat(JsonPath.<List<String>>read(json, "$.menu.items[?(!@)]"), hasItems("?")); //low
//assertThat(JsonPath.<List<String>>read(json, "$..[0]"), hasItems("?")); //low
/*
"$.menu.items[?(@ && @.id && !@.label)].id",
"$.menu.items[?(@ && @.label && /SVG/.test(@.label))].id",
"$.menu.items[?(!@)]",
"$..[0]"
*/
}

Loading…
Cancel
Save