Class JsonParser<T>
java.lang.Object
com.google.gson.TypeAdapter<T>
net.buildtheearth.terraminusminus.dataset.osm.JsonParser<T>
- Direct Known Subclasses:
BlockStateParser,JsonParser.Typed
public abstract class JsonParser<T>
extends com.google.gson.TypeAdapter<T>
Base implementation of
TypeAdapter for deserialzing-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParses a single value with a named type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T> readList(@NonNull com.google.gson.stream.JsonReader in, @NonNull net.daporkchop.lib.common.function.io.IOFunction<com.google.gson.stream.JsonReader, T> elementParser) static <T> List<T> readTypedList(@NonNull com.google.gson.stream.JsonReader in, @NonNull Class<T> type) static <T> List<T> readTypedList(@NonNull com.google.gson.stream.JsonReader in, @NonNull net.daporkchop.lib.common.function.io.IOBiFunction<String, com.google.gson.stream.JsonReader, T> elementParser) voidMethods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, read, toJson, toJson, toJsonTree
-
Constructor Details
-
JsonParser
public JsonParser()
-
-
Method Details
-
readList
public static <T> List<T> readList(@NonNull @NonNull com.google.gson.stream.JsonReader in, @NonNull @NonNull net.daporkchop.lib.common.function.io.IOFunction<com.google.gson.stream.JsonReader, T> elementParser) throws IOException- Throws:
IOException
-
readTypedList
public static <T> List<T> readTypedList(@NonNull @NonNull com.google.gson.stream.JsonReader in, @NonNull @NonNull Class<T> type) throws IOException - Throws:
IOException
-
readTypedList
public static <T> List<T> readTypedList(@NonNull @NonNull com.google.gson.stream.JsonReader in, @NonNull @NonNull net.daporkchop.lib.common.function.io.IOBiFunction<String, com.google.gson.stream.JsonReader, throws IOExceptionT> elementParser) - Throws:
IOException
-
write
- Specified by:
writein classcom.google.gson.TypeAdapter<T>- Throws:
IOException
-