Browse Source

remove unused methods from `JsonProvider` interface

pull/52/head
Jochen Berger 10 years ago
parent
commit
7dd5669991
  1. 17
      json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java
  2. 14
      json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java
  3. 5
      json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java

17
json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java

@ -23,12 +23,9 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class JacksonProvider extends AbstractJsonProvider {
@ -75,15 +72,6 @@ public class JacksonProvider extends AbstractJsonProvider {
}
}
@Override
public Object parse(Reader jsonReader) throws InvalidJsonException {
try {
return objectReader.readValue(jsonReader);
} catch (IOException e) {
throw new InvalidJsonException(e);
}
}
@Override
public Object parse(InputStream jsonStream) throws InvalidJsonException {
try {
@ -108,11 +96,6 @@ public class JacksonProvider extends AbstractJsonProvider {
}
}
@Override
public Map<String, Object> createMap() {
return new LinkedHashMap<String, Object>();
}
@Override
public List<Object> createArray() {
return new LinkedList<Object>();

14
json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java

@ -25,7 +25,6 @@ import net.minidev.json.parser.ParseException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.List;
import java.util.Map;
@ -43,10 +42,6 @@ public class JsonSmartJsonProvider extends AbstractJsonProvider {
this.mode = mode;
}
public Object createMap() {
return orderedMapper.createObject();
}
public Object createArray() {
return orderedMapper.createArray();
}
@ -59,15 +54,6 @@ public class JsonSmartJsonProvider extends AbstractJsonProvider {
}
}
@Override
public Object parse(Reader jsonReader) throws InvalidJsonException {
try {
return createParser().parse(jsonReader, orderedMapper);
} catch (ParseException e) {
throw new InvalidJsonException(e);
}
}
@Override
public Object parse(InputStream jsonStream) throws InvalidJsonException {
try {

5
json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java

@ -17,7 +17,6 @@ package com.jayway.jsonpath.spi.json;
import com.jayway.jsonpath.InvalidJsonException;
import java.io.InputStream;
import java.io.Reader;
import java.util.Collection;
public interface JsonProvider {
@ -26,14 +25,10 @@ public interface JsonProvider {
Object parse(String json) throws InvalidJsonException;
Object parse(Reader jsonReader) throws InvalidJsonException;
Object parse(InputStream jsonStream) throws InvalidJsonException;
String toJson(Object obj);
Object createMap();
Object createArray();
/**

Loading…
Cancel
Save