Interface IModelRepository<M extends IModel>
-
- Type Parameters:
M- the specific type of model
- All Known Implementing Classes:
BuildModel.VilModelRepository,ModelRepository,TemplateModel.VtlModelRepository,VarModel.IvmlModelRepository
public interface IModelRepository<M extends IModel>Defines the interface of a model repository.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description McreateModel(java.lang.String modelName, java.util.List<M> imports)Creates an ad-hoc model with given models as imports.java.util.List<VersionedModelInfos<M>>getAvailable(java.lang.String name)Returns models available for a given modelname.ModelLocations.LocationgetLocationFor(java.net.URI uri)Returns the location foruri.java.util.List<java.lang.String>getMatchingModelNames(java.lang.String name)Returns the matching model names for a potential wildcard name.ModelInfo<M>getModelInfo(java.lang.String name, Version version, java.net.URI uri)Returns a known model information object via its URI.booleanisOutdated(ModelInfo<M> info)Returns whether a model information is outdated.Mload(ModelInfo<M> info, java.util.List<IMessage> messages)Loads the model related toinfowith a new default import resolver.Mload(ModelInfo<M> info, ImportResolver<M> resolver, java.util.List<IMessage> messages)Loads the model related toinfowith the given import resolver.
-
-
-
Method Detail
-
getAvailable
java.util.List<VersionedModelInfos<M>> getAvailable(java.lang.String name)
Returns models available for a given modelname.- Parameters:
name- the name to search for- Returns:
- the available model or null
-
isOutdated
boolean isOutdated(ModelInfo<M> info)
Returns whether a model information is outdated.- Parameters:
info- the object to be tested- Returns:
trueif it is outdated,falseelse
-
load
M load(ModelInfo<M> info, java.util.List<IMessage> messages)
Loads the model related toinfowith a new default import resolver.- Parameters:
info- the model info to load the model formessages- the messages collected so far (modified as a side effect)- Returns:
- the loaded model or null
-
load
M load(ModelInfo<M> info, ImportResolver<M> resolver, java.util.List<IMessage> messages)
Loads the model related toinfowith the given import resolver.- Parameters:
info- the model info to load the model forresolver- 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
ModelInfo<M> getModelInfo(java.lang.String name, Version version, java.net.URI uri)
Returns a known model information object via its URI.- Parameters:
name- the name of the model to search forversion- the version of the model to search foruri- the URI to search for- Returns:
- the related model information object (or null if not found)
-
getLocationFor
ModelLocations.Location getLocationFor(java.net.URI uri)
Returns the location foruri.- Parameters:
uri- the URI to search for- Returns:
- the related location
-
getMatchingModelNames
java.util.List<java.lang.String> getMatchingModelNames(java.lang.String name)
Returns the matching model names for a potential wildcard name.- Parameters:
name- the name to return the matches for- Returns:
- if name is a wildcard name, all known matching names; else,
name
-
-