Class TypeResolverRegistry
java.lang.Object
org.wickedsource.docxstamper.api.typeresolver.TypeResolverRegistry
Registry for all implementations of ITypeResolver that are used by DocxStamper.
- Version:
- 1.6.6
- Author:
- Joseph Verron
-
Constructor Summary
ConstructorsConstructorDescriptionTypeResolverRegistry(ITypeResolver<Object> defaultResolver) Creates a new TypeResolverRegistry with the given default ITypeResolver. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fielddefaultResolver.<T> ITypeResolver<T> getResolverForType(Class<T> type) Gets the ITypeResolver that was registered for the specified type.<T> voidregisterTypeResolver(Class<T> resolvedType, ITypeResolver<T> resolver) Registers a new ITypeResolver for the given type.
-
Constructor Details
-
TypeResolverRegistry
Creates a new TypeResolverRegistry with the given default ITypeResolver.- Parameters:
defaultResolver- the ITypeResolver that is used when no specific resolver for a type is registered.
-
-
Method Details
-
registerTypeResolver
Registers a new ITypeResolver for the given type.- Type Parameters:
T- the type resolved by the ITypeResolver.- Parameters:
resolvedType- the type for which the resolver is registered.resolver- the ITypeResolver implementation to register.
-
getResolverForType
Gets the ITypeResolver that was registered for the specified type.- Type Parameters:
T- the type resolved by the ITypeResolver.- Parameters:
type- the class for which to find the ITypeResolver.- Returns:
- the ITypeResolver implementation that was earlier registered for the given class, or the default ITypeResolver if none is found.
-
getDefaultResolver
Getter for the field
defaultResolver.- Returns:
- a
ITypeResolverobject
-