Class GuiceObjectMapperFactory
- java.lang.Object
-
- ninja.leaping.configurate.objectmapping.GuiceObjectMapperFactory
-
- All Implemented Interfaces:
ObjectMapperFactory
@Singleton public final class GuiceObjectMapperFactory extends Object implements ObjectMapperFactory
A factory forObjectMappers that will inherit the injector from wherever it is provided.This class is intended to be constructed through Guice dependency injection.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGuiceObjectMapperFactory(com.google.inject.Injector baseInjector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> @NonNull ObjectMapper<T>getMapper(@NonNull TypeToken<T> type)Creates anObjectMapperfor the given type.<T> @NonNull ObjectMapper<T>getMapper(@NonNull Class<T> type)Creates anObjectMapperfor the given type.StringtoString()
-
-
-
Constructor Detail
-
GuiceObjectMapperFactory
@Inject protected GuiceObjectMapperFactory(com.google.inject.Injector baseInjector)
-
-
Method Detail
-
getMapper
public <T> @NonNull ObjectMapper<T> getMapper(@NonNull Class<T> type) throws ObjectMappingException
Description copied from interface:ObjectMapperFactoryCreates anObjectMapperfor the given type.- Specified by:
getMapperin interfaceObjectMapperFactory- Type Parameters:
T- The type- Parameters:
type- The type- Returns:
- An object mapper
- Throws:
ObjectMappingException- If an exception occured whilst mapping
-
getMapper
public <T> @NonNull ObjectMapper<T> getMapper(@NonNull TypeToken<T> type) throws ObjectMappingException
Description copied from interface:ObjectMapperFactoryCreates anObjectMapperfor the given type.- Specified by:
getMapperin interfaceObjectMapperFactory- Type Parameters:
T- The type- Parameters:
type- The type- Returns:
- An object mapper
- Throws:
ObjectMappingException- If an exception occured whilst mapping
-
-