42 lines
1.2 KiB
Java
42 lines
1.2 KiB
Java
package cn.citycraft.GsonAgent.normal;
|
|
|
|
import java.io.Reader;
|
|
|
|
import cn.citycraft.GsonAgent.api.exception.JsonIOException;
|
|
import cn.citycraft.GsonAgent.api.exception.JsonSyntaxException;
|
|
import cn.citycraft.GsonAgent.normal.stream.JsonReaderHandle;
|
|
|
|
public class JsonParserHandle implements cn.citycraft.GsonAgent.api.JsonParser {
|
|
|
|
public com.google.gson.JsonParser handle;
|
|
|
|
public JsonParserHandle() {
|
|
handle = new com.google.gson.JsonParser();
|
|
}
|
|
|
|
protected JsonParserHandle(final com.google.gson.JsonParser handle) {
|
|
this.handle = handle;
|
|
}
|
|
|
|
@Override
|
|
public com.google.gson.JsonParser getHandle() {
|
|
return this.handle;
|
|
}
|
|
|
|
@Override
|
|
public JsonElementHandle parse(final cn.citycraft.GsonAgent.api.stream.JsonReader json) throws JsonIOException, JsonSyntaxException {
|
|
return new JsonElementHandle(getHandle().parse(((JsonReaderHandle) json).getHandle()));
|
|
}
|
|
|
|
@Override
|
|
public JsonElementHandle parse(final Reader json) throws JsonIOException, JsonSyntaxException {
|
|
return new JsonElementHandle(getHandle().parse(json));
|
|
}
|
|
|
|
@Override
|
|
public JsonElementHandle parse(final String json) throws JsonSyntaxException {
|
|
return new JsonElementHandle(getHandle().parse(json));
|
|
}
|
|
|
|
}
|