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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Parses a single value with a named type.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <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)
     
    void
    write(com.google.gson.stream.JsonWriter out, T value)
     

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, read, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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,T> elementParser) throws IOException
      Throws:
      IOException
    • write

      public void write(com.google.gson.stream.JsonWriter out, T value) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<T>
      Throws:
      IOException