Class ModelRepository<M extends IModel>

    • Constructor Detail

      • ModelRepository

        protected ModelRepository​(ModelManagement<M> modelMgmt)
        Creates a model repository.
        Parameters:
        modelMgmt - the model management instance to delegate to
    • Method Detail

      • getAvailable

        public java.util.List<VersionedModelInfos<M>> getAvailable​(java.lang.String name)
        Description copied from interface: IModelRepository
        Returns models available for a given model name.
        Specified by:
        getAvailable in interface IModelRepository<M extends IModel>
        Parameters:
        name - the name to search for
        Returns:
        the available model or null
      • isOutdated

        public boolean isOutdated​(ModelInfo<M> info)
        Description copied from interface: IModelRepository
        Returns whether a model information is outdated.
        Specified by:
        isOutdated in interface IModelRepository<M extends IModel>
        Parameters:
        info - the object to be tested
        Returns:
        true if it is outdated, false else
      • load

        public M load​(ModelInfo<M> info,
                      java.util.List<IMessage> messages)
        Description copied from interface: IModelRepository
        Loads the model related to info with a new default import resolver.
        Specified by:
        load in interface IModelRepository<M extends IModel>
        Parameters:
        info - the model info to load the model for
        messages - the messages collected so far (modified as a side effect)
        Returns:
        the loaded model or null
      • load

        public M load​(ModelInfo<M> info,
                      ImportResolver<M> resolver,
                      java.util.List<IMessage> messages)
        Description copied from interface: IModelRepository
        Loads the model related to info with the given import resolver.
        Specified by:
        load in interface IModelRepository<M extends IModel>
        Parameters:
        info - the model info to load the model for
        resolver - the import resolver to use (null for a new default resolver)
        messages - the messages collected so far (modified as a side effect)
        Returns:
        the loaded model or null
      • getModelInfo

        public ModelInfo<M> getModelInfo​(java.lang.String name,
                                         Version version,
                                         java.net.URI uri)
        Description copied from interface: IModelRepository
        Returns a known model information object via its URI.
        Specified by:
        getModelInfo in interface IModelRepository<M extends IModel>
        Parameters:
        name - the name of the model to search for
        version - the version of the model to search for
        uri - the URI to search for
        Returns:
        the related model information object (or null if not found)
      • getMatchingModelNames

        public java.util.List<java.lang.String> getMatchingModelNames​(java.lang.String name)
        Description copied from interface: IModelRepository
        Returns the matching model names for a potential wildcard name.
        Specified by:
        getMatchingModelNames in interface IModelRepository<M extends IModel>
        Parameters:
        name - the name to return the matches for
        Returns:
        if name is a wildcard name, all known matching names; else, name
      • getResolvedModelInfo

        public ModelInfo<M> getResolvedModelInfo​(M model)
        Returns the model information object for the given model by considering resolved models.
        Specified by:
        getResolvedModelInfo in interface IModelManagementRepository<M extends IModel>
        Parameters:
        model - the model to search an information object for which resolves model
        Returns:
        the related model information object or null if there is none