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
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.logging.log4j.Logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAttributeFactoryResolver(Class<A> annotationType) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable TgetDefaultValue(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 booleanisSensitive(A annotation) booleansupportsKey(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:FactoryResolverChecks 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:
supportsKeyin interfaceFactoryResolver<T>- Parameters:
key- the key to check for support- Returns:
- true if this resolver supports the key
-
getFactory
Description copied from interface:FactoryResolverGets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is aKeycombined with alias names and the annotated element this factory is for.- Specified by:
getFactoryin 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)
-