Class DefaultFactoryRegistry
java.lang.Object
org.apache.camel.dataformat.bindy.format.factories.DefaultFactoryRegistry
- All Implemented Interfaces:
FactoryRegistry
This class manages all FormatFactoryInterfaces. FormatFactoryInterfaces can declare to support one or more classes or
can declare to be generic (e.g.
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindForFormattingOptions
(FormattingOptions formattingOptions) register
(FormatFactoryInterface... formatFactories) Registers aFormatFactoryInterface
.unregister
(Class<? extends FormatFactoryInterface> clazz)
-
Constructor Details
-
DefaultFactoryRegistry
public DefaultFactoryRegistry()
-
-
Method Details
-
register
Registers aFormatFactoryInterface
. Two types of factories exist:- Factories that support one or more classes
- Factories that support no specific class (e.g.
EnumFormatFactory
)
- Specified by:
register
in interfaceFactoryRegistry
- Parameters:
formatFactories
-- Returns:
- the DefaultFactoryRegistry instance
-
unregister
- Specified by:
unregister
in interfaceFactoryRegistry
-
findForFormattingOptions
- Specified by:
findForFormattingOptions
in interfaceFactoryRegistry
-