Class DefaultFactoryRegistry
- java.lang.Object
-
- org.apache.camel.dataformat.bindy.format.factories.DefaultFactoryRegistry
-
- All Implemented Interfaces:
FactoryRegistry
public final class DefaultFactoryRegistry extends Object implements 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
Constructors Constructor Description DefaultFactoryRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatFactoryInterfacefindForFormattingOptions(FormattingOptions formattingOptions)FactoryRegistryregister(FormatFactoryInterface... formatFactories)Registers aFormatFactoryInterface.FactoryRegistryunregister(Class<? extends FormatFactoryInterface> clazz)
-
-
-
Method Detail
-
register
public FactoryRegistry register(FormatFactoryInterface... formatFactories)
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:
registerin interfaceFactoryRegistry- Parameters:
formatFactories-- Returns:
- the DefaultFactoryRegistry instance
-
unregister
public FactoryRegistry unregister(Class<? extends FormatFactoryInterface> clazz)
- Specified by:
unregisterin interfaceFactoryRegistry
-
findForFormattingOptions
public FormatFactoryInterface findForFormattingOptions(FormattingOptions formattingOptions)
- Specified by:
findForFormattingOptionsin interfaceFactoryRegistry
-
-