diff --git a/jsurfer-benchmark/pom.xml b/jsurfer-benchmark/pom.xml
index 3daa4c3..9d9c483 100644
--- a/jsurfer-benchmark/pom.xml
+++ b/jsurfer-benchmark/pom.xml
@@ -5,7 +5,7 @@
jsurfer
com.github.jsurfer
- 1.3.0-SNAPSHOT
+ 1.2.6
4.0.0
diff --git a/jsurfer-core/pom.xml b/jsurfer-core/pom.xml
index 9c0c966..4165f5a 100644
--- a/jsurfer-core/pom.xml
+++ b/jsurfer-core/pom.xml
@@ -5,7 +5,7 @@
jsurfer
com.github.jsurfer
- 1.3.0-SNAPSHOT
+ 1.2.6
4.0.0
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/JsonDomBuilder.java b/jsurfer-core/src/main/java/org/jsfr/json/JsonDomBuilder.java
index 4127756..59614eb 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/JsonDomBuilder.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/JsonDomBuilder.java
@@ -64,10 +64,10 @@ public boolean startObject() {
Object newObject = provider.createObject();
switch (scope) {
case IN_OBJECT:
- provider.consumeObjectEntry(currentNode, propertyName, newObject);
+ provider.put(currentNode, propertyName, newObject);
break;
case IN_ARRAY:
- provider.consumeArrayElement(currentNode, newObject);
+ provider.add(currentNode, newObject);
break;
case IN_ROOT:
break;
@@ -127,10 +127,10 @@ public boolean startArray() {
Object newArray = provider.createArray();
switch (scope) {
case IN_OBJECT:
- provider.consumeObjectEntry(currentNode, propertyName, newArray);
+ provider.put(currentNode, propertyName, newArray);
break;
case IN_ARRAY:
- provider.consumeArrayElement(currentNode, newArray);
+ provider.add(currentNode, newArray);
break;
case IN_ROOT:
break;
@@ -150,10 +150,10 @@ public boolean endArray() {
private void consumePrimitive(Object value) {
switch (scope) {
case IN_OBJECT:
- provider.consumeObjectEntry(currentNode, propertyName, value);
+ provider.put(currentNode, propertyName, value);
break;
case IN_ARRAY:
- provider.consumeArrayElement(currentNode, value);
+ provider.add(currentNode, value);
break;
case IN_ROOT:
currentNode = value;
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/TypedJsonPathListener.java b/jsurfer-core/src/main/java/org/jsfr/json/TypedJsonPathListener.java
index 0b0e0e5..50921db 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/TypedJsonPathListener.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/TypedJsonPathListener.java
@@ -24,9 +24,6 @@
package org.jsfr.json;
-/**
- * Created by Leo on 2015/4/28.
- */
public interface TypedJsonPathListener {
void onTypedValue(T value, ParsingContext context) throws Exception;
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/exception/ResolveException.java b/jsurfer-core/src/main/java/org/jsfr/json/exception/ResolverException.java
similarity index 90%
rename from jsurfer-core/src/main/java/org/jsfr/json/exception/ResolveException.java
rename to jsurfer-core/src/main/java/org/jsfr/json/exception/ResolverException.java
index 362d14d..e199945 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/exception/ResolveException.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/exception/ResolverException.java
@@ -24,9 +24,9 @@
package org.jsfr.json.exception;
-public class ResolveException extends RuntimeException {
+public class ResolverException extends RuntimeException {
- public ResolveException(String message, Throwable cause) {
+ public ResolverException(String message, Throwable cause) {
super(message, cause);
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/path/ArrayIndex.java b/jsurfer-core/src/main/java/org/jsfr/json/path/ArrayIndex.java
index d16eff0..591a3b0 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/path/ArrayIndex.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/path/ArrayIndex.java
@@ -24,7 +24,7 @@
package org.jsfr.json.path;
-import org.jsfr.json.resolver.JsonPathResolver;
+import org.jsfr.json.resolver.DocumentResolver;
/**
* Created by Administrator on 2015/3/22.
@@ -63,7 +63,7 @@ public boolean match(PathOperator pathOperator) {
}
@Override
- public Object resolve(Object document, JsonPathResolver resolver) {
+ public Object resolve(Object document, DocumentResolver resolver) {
return resolver.resolve(document, arrayIndex);
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/path/ChildNode.java b/jsurfer-core/src/main/java/org/jsfr/json/path/ChildNode.java
index ae31b28..81ca017 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/path/ChildNode.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/path/ChildNode.java
@@ -24,13 +24,10 @@
package org.jsfr.json.path;
-import org.jsfr.json.resolver.JsonPathResolver;
+import org.jsfr.json.resolver.DocumentResolver;
import java.util.Objects;
-/**
- * Created by Administrator on 2015/3/22.
- */
public class ChildNode extends PathOperator {
private String key;
@@ -53,7 +50,7 @@ public boolean match(PathOperator pathOperator) {
}
@Override
- public Object resolve(Object document, JsonPathResolver resolver) {
+ public Object resolve(Object document, DocumentResolver resolver) {
return resolver.resolve(document, key);
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/path/JsonPath.java b/jsurfer-core/src/main/java/org/jsfr/json/path/JsonPath.java
index d265ad2..76f2521 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/path/JsonPath.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/path/JsonPath.java
@@ -24,7 +24,7 @@
package org.jsfr.json.path;
-import org.jsfr.json.resolver.JsonPathResolver;
+import org.jsfr.json.resolver.DocumentResolver;
import java.util.Arrays;
import java.util.Collections;
@@ -34,7 +34,7 @@
import java.util.ListIterator;
import java.util.Stack;
-public class JsonPath implements Iterable, Resolvable {
+public class JsonPath implements Iterable {
@Override
public Iterator iterator() {
@@ -124,8 +124,7 @@ public JsonPath build() {
protected Stack operators = new Stack();
- @Override
- public Object resolve(Object document, JsonPathResolver resolver) {
+ public Object resolve(Object document, DocumentResolver resolver) {
if (!this.isDefinite()) {
throw new IllegalArgumentException("Indefinite JsonPath is not supported.");
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/path/PathOperator.java b/jsurfer-core/src/main/java/org/jsfr/json/path/PathOperator.java
index 16c9911..4689b69 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/path/PathOperator.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/path/PathOperator.java
@@ -24,7 +24,8 @@
package org.jsfr.json.path;
-import org.jsfr.json.resolver.JsonPathResolver;
+import org.jsfr.json.resolver.DocumentResolver;
+import org.jsfr.json.resolver.Resolvable;
public abstract class PathOperator implements Resolvable {
@@ -44,7 +45,7 @@ public boolean match(PathOperator pathOperator) {
}
@Override
- public Object resolve(Object document, JsonPathResolver resolver) {
+ public Object resolve(Object document, DocumentResolver resolver) {
throw new UnsupportedOperationException("Not supported");
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/path/Root.java b/jsurfer-core/src/main/java/org/jsfr/json/path/Root.java
index 0f3d66c..1cb274d 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/path/Root.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/path/Root.java
@@ -24,7 +24,7 @@
package org.jsfr.json.path;
-import org.jsfr.json.resolver.JsonPathResolver;
+import org.jsfr.json.resolver.DocumentResolver;
public class Root extends PathOperator {
@@ -38,7 +38,7 @@ private Root() {
}
@Override
- public Object resolve(Object document, JsonPathResolver resolver) {
+ public Object resolve(Object document, DocumentResolver resolver) {
return document;
}
diff --git a/jsurfer-core/src/main/java/org/jsfr/json/provider/GsonProvider.java b/jsurfer-core/src/main/java/org/jsfr/json/provider/GsonProvider.java
index e3598d2..896ab64 100644
--- a/jsurfer-core/src/main/java/org/jsfr/json/provider/GsonProvider.java
+++ b/jsurfer-core/src/main/java/org/jsfr/json/provider/GsonProvider.java
@@ -39,7 +39,7 @@ public class GsonProvider implements JsonProvider object, String key, Object value) {
+ public void put(Map object, String key, Object value) {
object.put(key, value);
}
@Override
- public void consumeArrayElement(List