Class AnnotationItemProviderAdapterFactory

All Implemented Interfaces:
AdapterFactory, ComposeableAdapterFactory, IChangeNotifier, IDisposable
Direct Known Subclasses:

public abstract class AnnotationItemProviderAdapterFactory extends AdapterFactoryImpl implements ComposeableAdapterFactory, IChangeNotifier, IDisposable
A base class for supporting the specialization of AnnotationItemProvider and StringToStringMapEntryItemProvider.

The EtypesItemProviderAdapterFactory has a specialized adapt method that uses this class' create(String) method to create specialized implementations of this factory depending on the annotation's source. Before creating an AnnotationItemProvider or creating an StringToStringMapEntryItemProvider, EtypesItemProviderAdapterFactory will call createAnnotationAdapter() or createStringToStringMapEntryAdapter() on this factory. If this factory returns one, that one will be used. When EtypesItemProviderAdapterFactory creates an instance of this class, it calls setParentAdapterFactory(EtypesItemProviderAdapterFactory) so that this factory has a path back to the getRootAdapterFactory(). When EtypesItemProviderAdapterFactory is disposed it will dispose this factory.

By default, the createAnnotationAdapter() and the createStringToStringMapEntryAdapter() simply create an AnnotationItemProvider or an StringToStringMapEntryItemProvider, passing in this factory to the constructors.

All methods are implemented by this class, but the factory is abstract because it's expected that a derived class will specialize some of the methods. A derived class could override doCreateAnnotationAdapter(), doCreateStringToStringMapEntryAdapter(), or both in order to support specialized stateless adapters. A derived class could instead override createAnnotationAdapter(), createStringToStringMapEntryAdapter(), or both in order to support specialized stateful adapters. However, based on AnnotationItemProvider.getAnnotationItemProviderAdapterFactory() and StringToStringMapEntryItemProvider.getAnnotationItemProviderAdapterFactory(), both existing implementations are specialized to delegate back to this factory's getPropertyDescriptor, getPropertyDescriptors, and createPropertyDescriptorDecorator methods, so those are the methods most likely to be specialized.

It's generally expected that there will be a corresponding AnnotationValidator also associated with the annotation source which which this factory provides specialized adapters. That annotation validator's assistant is used to drive much of the specialized behavior.