Interface DataSourceFactoryFromName

  • All Known Implementing Classes:
    FilePerRootDataSourceFactory, RegularFileDataSourceFactory

    public interface DataSourceFactoryFromName
    Interface for creating a new DataSource from a given model name. It is somehow vital to extract the strategy defining the location (data source) of the new model when the name is given. One could choose the place to store a model in various ways depending on the structure of the model name (for example if we are java-minded we might store a model with a name 'my.favourite.package.modelName' as a folder cascade: 'my/favourite/package/modelName.mps'). It is used when we create a new model from anywhere (IDE, tests, etc.).
    Since:
    3.5
    See Also:
    DataSourceFactoryFromURL
    • Method Detail

      • create

        @NotNull
        DataSource create​(@NotNull
                          SModelName modelName,
                          @NotNull
                          SourceRoot sourceRoot)
        This is invoked in order to create a new model from scratch given only its name. For instance it might be useful if we want to put a model accordingly to it's fq name or if we want to provide some specific extension of the new model file (if we are based on file system).
        Parameters:
        modelName - new model name
        sourceRoot - source root which will host the newly created model
        Returns:
        new data source which points to location generated by this method from the model name