32 lines
869 B
Java
32 lines
869 B
Java
package cn.citycraft.GsonAgent.api;
|
|
|
|
import java.io.IOException;
|
|
import java.io.Reader;
|
|
import java.io.Writer;
|
|
|
|
import cn.citycraft.GsonAgent.api.stream.JsonReader;
|
|
import cn.citycraft.GsonAgent.api.stream.JsonWriter;
|
|
import cn.citycraft.GsonAgent.api.utils.HandleInterface;
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
public abstract interface TypeAdapter<T> extends HandleInterface {
|
|
|
|
public T fromJson(Reader in) throws IOException;
|
|
|
|
public T fromJson(String json) throws IOException;
|
|
|
|
public T fromJsonTree(JsonElement jsonTree);
|
|
|
|
public TypeAdapter<T> nullSafe();
|
|
|
|
public abstract T read(JsonReader paramJsonReader) throws IOException;
|
|
|
|
public String toJson(T value) throws IOException;
|
|
|
|
public void toJson(Writer out, T value) throws IOException;
|
|
|
|
public JsonElement toJsonTree(T value);
|
|
|
|
public void write(JsonWriter paramJsonWriter, T paramT) throws IOException;
|
|
}
|