public class JSONMappings extends Object
| Constructor and Description |
|---|
JSONMappings() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
addImplementation(Class<T> iface,
Class<? extends T> implementation)
Declare default implementation for an interface.
|
static <T> Class<? extends T> |
getImplementation(Class<T> iface)
Find default implementation for an interface.
|
static JSONMappings |
getInstance()
Get the single instance.
|
static <T extends Collection> |
getJSONCollectionMapper(Class<T> collectionClass,
Type elementType)
Get a JSONMapper for a Collection or create a new one.
|
static JSONMapper<Map> |
getJSONMapMapper(Type keyType,
Type valueType)
Get a JSONMapper for a Map or create a new one.
|
static <T> JSONMapper<T> |
getJSONMapper(Class<T> clazz)
Get a JSONMapper for a class or create a new one.
|
static <T> JSONMapper<T> |
getJSONMapper(Class<T> clazz,
Map<String,Type> args)
Get a JSONMapper for a class or create a new one.
|
static <T> JSONMapper<T> |
getJSONMapper(Type type,
Class<T> clazz)
Get a JSONMapper for a class or create a new one.
|
static <T> JSONMapper<T> |
getJSONMapper(Type type,
Class<T> clazz,
Map<String,Type> args)
Get a JSONMapper for a class or create a new one.
|
static boolean |
isJSONCompatible(Class<?> clazz) |
static void |
reset()
Reset the factory to its original state.
|
static <T> void |
setMapper(Class<T> clazz,
JSONMapper<T> mapper)
Declare mapper for a class.
|
static <T> void |
setMapper(Type type,
Class<T> clazz,
JSONMapper<T> mapper)
Declare mapper for a class.
|
public static JSONMappings getInstance()
public static void reset()
public static <T> JSONMapper<T> getJSONMapper(Type type, Class<T> clazz, Map<String,Type> args)
T - the mapper typetype - class typeclazz - the classargs - type parameter name to type mappingpublic static <T> JSONMapper<T> getJSONMapper(Type type, Class<T> clazz)
T - the mapper typetype - class typeclazz - the classpublic static <T> JSONMapper<T> getJSONMapper(Class<T> clazz, Map<String,Type> args)
T - the mapper typeclazz - the classargs - type parameter name to type mappingpublic static <T> JSONMapper<T> getJSONMapper(Class<T> clazz)
T - the mapper typeclazz - the classpublic static <T extends Collection> JSONMapper<T> getJSONCollectionMapper(Class<T> collectionClass, Type elementType)
T - the collection typecollectionClass - the collection typeelementType - the type of the collection's elementspublic static JSONMapper<Map> getJSONMapMapper(Type keyType, Type valueType)
keyType - type of the map's keysvalueType - type of the map's valuespublic static <T> void setMapper(Type type, Class<T> clazz, JSONMapper<T> mapper)
T - the mapper typetype - class typeclazz - the classmapper - the mapperpublic static <T> void setMapper(Class<T> clazz, JSONMapper<T> mapper)
T - the mapper typeclazz - the classmapper - the mapperpublic static <T> Class<? extends T> getImplementation(Class<T> iface)
T - the mapper typeiface - the interfacepublic static <T> void addImplementation(Class<T> iface, Class<? extends T> implementation)
T - the mapper typeiface - the interfaceimplementation - the implementationpublic static boolean isJSONCompatible(Class<?> clazz)
Copyright © 2014–2015 Tomas Teubner. All rights reserved.