Interface ModelLoader

All Known Implementing Classes:
NextGenInvocation

public interface ModelLoader

A ModelLoader is responsible for creating an instane of Model from a given URI. It is called from the NextGen whenever a new instance of the model is needed. Typically every cartridge has at least one ModelLoader.

You should not buffer the model instances. This can lead to unpredictable side effects when transformations running on that model.

The ModelLoader is located via the java intern ServiceLoader-Mechanism. So it is possible that there are more than one model loader in a generation session.

The ModelLoader can tell via the canHandle method if it is able to handle the requested

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandle(String modelURI)
    Is this instance of ModelLoader able to handle the requested model?
     
    loadModel(String modelURI)
    Load the Data from the given URI and return a fresh new instance of Model.
  • Method Details

    • canHandle

      boolean canHandle(String modelURI)
      Is this instance of ModelLoader able to handle the requested model?
      Parameters:
      modelURI - and URI to the model. It could be a file, a URL ore any other URI
      Returns:
      true if the ModelLoader can handle the model.
    • loadModel

      Model loadModel(String modelURI)
      Load the Data from the given URI and return a fresh new instance of Model.
      Parameters:
      modelURI -
      Returns:
      Model
      See Also:
    • getModelElementFactory

      default ModelElementFactory getModelElementFactory()