public class MapperFactory extends Object
| Constructor and Description |
|---|
MapperFactory() |
| 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 MapperFactory |
getInstance()
Get the single instance.
|
static <T> JSONMapper<T> |
getJSONMapper(Class<T> clazz)
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 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 MapperFactory getInstance()
public static void reset()
public static <T> JSONMapper<T> getJSONMapper(Type type, Class<T> clazz)
type - class typeclazz - the classpublic static <T> JSONMapper<T> getJSONMapper(Class<T> clazz)
clazz - the classpublic static <T> void setMapper(Type type, Class<T> clazz, JSONMapper<T> mapper)
type - class typeclazz - the classmapper - the mapperpublic static <T> void setMapper(Class<T> clazz, JSONMapper<T> mapper)
clazz - the classmapper - the mapperpublic static <T> Class<? extends T> getImplementation(Class<T> iface)
iface - the interfacepublic static <T> void addImplementation(Class<T> iface, Class<? extends T> implementation)
iface - the interfaceimplementation - the implementationpublic static boolean isJSONCompatible(Class<?> clazz)
Copyright © 2014 Tomas Teubner. All rights reserved.