Class AbstractAttributeFactoryResolver<T,A extends Annotation>

java.lang.Object
org.apache.logging.log4j.plugins.di.resolver.AbstractAttributeFactoryResolver<T,A>
All Implemented Interfaces:
FactoryResolver<T>
Direct Known Subclasses:
PluginAttributeFactoryResolver, PluginBuilderAttributeFactoryResolver

public abstract class AbstractAttributeFactoryResolver<T,A extends Annotation> extends Object implements FactoryResolver<T>
  • Field Details

    • LOGGER

      protected static final org.apache.logging.log4j.Logger LOGGER
    • annotationType

      protected final Class<A extends Annotation> annotationType
  • Constructor Details

    • AbstractAttributeFactoryResolver

      protected AbstractAttributeFactoryResolver(Class<A> annotationType)
  • Method Details

    • supportsKey

      public boolean supportsKey(Key<?> key)
      Description copied from interface: FactoryResolver
      Checks if this resolver supports the provided key. If this returns true, then the factory returned by FactoryResolver.getFactory(ResolvableKey, InstanceFactory) will be used to create a binding for the key.
      Specified by:
      supportsKey in interface FactoryResolver<T>
      Parameters:
      key - the key to check for support
      Returns:
      true if this resolver supports the key
    • getFactory

      public Supplier<T> getFactory(ResolvableKey<T> resolvableKey, InstanceFactory instanceFactory)
      Description copied from interface: FactoryResolver
      Gets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is a Key combined with alias names and the annotated element this factory is for.
      Specified by:
      getFactory in interface FactoryResolver<T>
      Parameters:
      resolvableKey - the resolvable key to create a binding for
      instanceFactory - the existing instance factory to use for composing bindings
      Returns:
      a factory for instances described by the provided key
    • isSensitive

      protected abstract boolean isSensitive(A annotation)
    • getDefaultValue

      protected abstract @Nullable T getDefaultValue(A annotation, StringValueResolver resolver, Type type, TypeConverter<T> typeConverter)