public final class DefaultFactoryRegistry extends Object implements FactoryRegistry
EnumFormatFactory).
The factories that support one or more classes are stored in a Map.
The generic factories are stored in a list.
The build method first tries to findForFormattingOptions a factory using the map.
If it doesn't findForFormattingOptions one it uses the generic list.
If it can't findForFormattingOptions a factory it throws an IllegalArgumentException.| Constructor and Description |
|---|
DefaultFactoryRegistry() |
| Modifier and Type | Method and Description |
|---|---|
FormatFactoryInterface |
findForFormattingOptions(FormattingOptions formattingOptions) |
FactoryRegistry |
register(FormatFactoryInterface... formatFactories)
Registers a
FormatFactoryInterface. |
FactoryRegistry |
unregister(Class<? extends FormatFactoryInterface> clazz) |
public FactoryRegistry register(FormatFactoryInterface... formatFactories)
FormatFactoryInterface.
Two types of factories exist:
EnumFormatFactory)register in interface FactoryRegistryformatFactories - public FactoryRegistry unregister(Class<? extends FormatFactoryInterface> clazz)
unregister in interface FactoryRegistrypublic FormatFactoryInterface findForFormattingOptions(FormattingOptions formattingOptions)
findForFormattingOptions in interface FactoryRegistryApache Camel