Class JSONConverterSet

java.lang.Object
com.blackrook.json.JSONConverterSet

public class JSONConverterSet extends Object
A set of converters for converting Java object types to JSON types, and back. Used in creating JSONObjects and reading/writing JSON.
Since:
1.3.0
Author:
Matthew Tropiano
  • Constructor Details

    • JSONConverterSet

      public JSONConverterSet()
      Creates a new converter set.
  • Method Details

    • getConverter

      public <E> JSONConverter<E> getConverter(Class<E> clazz)
      Gets a converter for a type.
      Type Parameters:
      E - the class type.
      Parameters:
      clazz - the class to get the converter for.
      Returns:
      a converter to use for JSON conversion.
    • setConverter

      public <E> void setConverter(Class<E> clazz, JSONConverter<E> converter)
      Sets a converter for a type.
      Type Parameters:
      E - the class type.
      Parameters:
      clazz - the class to get the converter for.
      converter - the converter to use for JSON conversion.