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 Summary
Modifier and TypeFieldDescriptionprotected static final org.apache.logging.log4j.Logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractAttributeFactoryResolver
(Class<A> annotationType) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable T
getDefaultValue
(A annotation, StringValueResolver resolver, Type type, TypeConverter<T> typeConverter) getFactory
(ResolvableKey<T> resolvableKey, InstanceFactory instanceFactory) Gets a factory for the given resolvable key using existing bindings from the given instance factory.protected abstract boolean
isSensitive
(A annotation) boolean
supportsKey
(Key<?> key) Checks if this resolver supports the provided key.
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
annotationType
-
-
Constructor Details
-
AbstractAttributeFactoryResolver
-
-
Method Details
-
supportsKey
Description copied from interface:FactoryResolver
Checks if this resolver supports the provided key. If this returnstrue
, then the factory returned byFactoryResolver.getFactory(ResolvableKey, InstanceFactory)
will be used to create a binding for the key.- Specified by:
supportsKey
in interfaceFactoryResolver<T>
- Parameters:
key
- the key to check for support- Returns:
- true if this resolver supports the key
-
getFactory
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 aKey
combined with alias names and the annotated element this factory is for.- Specified by:
getFactory
in interfaceFactoryResolver<T>
- Parameters:
resolvableKey
- the resolvable key to create a binding forinstanceFactory
- the existing instance factory to use for composing bindings- Returns:
- a factory for instances described by the provided key
-
isSensitive
-
getDefaultValue
protected abstract @Nullable T getDefaultValue(A annotation, StringValueResolver resolver, Type type, TypeConverter<T> typeConverter)
-