Package com.blackrook.json
Class JSONConverterSet
java.lang.Object
com.blackrook.json.JSONConverterSet
A set of converters for converting Java object types to JSON types, and back.
Used in creating
JSONObject
s and reading/writing JSON.- Since:
- 1.3.0
- Author:
- Matthew Tropiano
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<E> JSONConverter<E>
getConverter
(Class<E> clazz) Gets a converter for a type.<E> void
setConverter
(Class<E> clazz, JSONConverter<E> converter) Sets a converter for a type.
-
Constructor Details
-
JSONConverterSet
public JSONConverterSet()Creates a new converter set.
-
-
Method Details
-
getConverter
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
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.
-