Class TypeResolverRegistry

java.lang.Object
org.wickedsource.docxstamper.api.typeresolver.TypeResolverRegistry

public class TypeResolverRegistry extends Object
Registry for all implementations of ITypeResolver that are used by DocxStamper.
Version:
1.6.6
Author:
Joseph Verron
  • Constructor Details

    • TypeResolverRegistry

      public TypeResolverRegistry(ITypeResolver<Object> defaultResolver)
      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

      public <T> void registerTypeResolver(Class<T> resolvedType, ITypeResolver<T> resolver)
      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

      public <T> ITypeResolver<T> getResolverForType(Class<T> type)
      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

      public ITypeResolver<Object> getDefaultResolver()

      Getter for the field defaultResolver.

      Returns:
      a ITypeResolver object