Package jetbrains.mps.extapi.persistence
Interface ModelFactoryRegistry
- 
- All Known Implementing Classes:
 ModelFactoryService
public interface ModelFactoryRegistryStores default associations betweenModelFactoryandDataSourceType. It is a many-to-many mapping. Also it stores a mapping between model factory types and model factories (which allows user to replace the bundled persistence we provide)- Since:
 - 12/22/16
 - See Also:
 ModelFactory,DataSourceType
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ModelFactorygetDefaultModelFactory(DataSourceType dataSourceType)Returns the last registered factory (order of registration) which correspond to the specifiedkey.List<ModelFactory>getFactories()ModelFactorygetFactoryByType(ModelFactoryType factoryId)Clients can gain from this logic by replacing the existing model factory logic inList<ModelFactoryType>getFactoryTypes()List<ModelFactory>getModelFactories(DataSourceType dataSourceType) 
 - 
 
- 
- 
Method Detail
- 
getFactories
@NotNull List<ModelFactory> getFactories()
- Returns:
 - all registered factories
 
 
- 
getFactoryByType
@Nullable ModelFactory getFactoryByType(@NotNull ModelFactoryType factoryId)
Clients can gain from this logic by replacing the existing model factory logic in- Parameters:
 factoryId- -- unique identifier- Returns:
 - the last registered factory with the given id
 
 
- 
getDefaultModelFactory
@Nullable ModelFactory getDefaultModelFactory(@NotNull DataSourceType dataSourceType)
Returns the last registered factory (order of registration) which correspond to the specifiedkey. Must be a shorthand forgetModelFactories(dataSourceType)?.getLast()- Returns:
 - null if there is no model factory which is registered to the specified data source
 
 
- 
getModelFactories
@NotNull List<ModelFactory> getModelFactories(@NotNull DataSourceType dataSourceType)
- Returns:
 - all the registered factories for the provided data source type sorted:
 1. by the preferences of the model factory (
ModelFactory.getPreferredDataSourceTypes(), 2. in the reverse order of registration: the last one has a top priority 
 
- 
getFactoryTypes
@NotNull List<ModelFactoryType> getFactoryTypes()
- Returns:
 - all the factory types registered
 
 
 - 
 
 -