Class IModelAccess

  • Direct Known Subclasses:
    IModelAccess

    public abstract class IModelAccess
    extends java.lang.Object
    A basic class providing access to models. Specific tool integrations shall add specific methods on how to access or even create models.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • IModelAccess

        public IModelAccess()
    • Method Detail

      • matchesOrigin

        protected boolean matchesOrigin​(IModelInfo info)
        Returns whether the model information matches this origin.
        Parameters:
        info - the model information instance
        Returns:
        true if the origins match, false else
        Throws:
        java.lang.IllegalArgumentException - in case that info is null or does not match to this implementation
      • checkInfo

        protected void checkInfo​(IModelInfo info)
        Checks the validity of info.
        Parameters:
        info - the instance to check
        Throws:
        java.lang.IllegalArgumentException - in case that info is null or does not match to this implementation
      • getInfo

        protected ModelInfo<Project> getInfo​(IModelInfo info)
        Returns the stored project information instance.
        Parameters:
        info - the model information instance
        Returns:
        the contained project information instance
        Throws:
        java.lang.IllegalArgumentException - in case that info is null or does not match to this implementation
      • createInfo

        protected IModelInfo createInfo​(ModelInfo<Project> info,
                                        IModelAccess access)
        Factory method for creating a project information object.
        Parameters:
        info - the project info instance to be wrapped
        access - the instance which created this object (for consistency reasons)
        Returns:
        the created instance
      • obtainProject

        protected Project obtainProject​(IModelInfo info)
                                 throws ModelException
        Obtains a project.
        Parameters:
        info - the model information instance representing the project to obtain
        Returns:
        the project instance
        Throws:
        ModelException - in case of errors during obtaining/loading the model
        java.lang.IllegalArgumentException - in case that info is null or does not match to this implementation
      • getMostRecentModel

        public static IModelInfo getMostRecentModel​(java.util.List<IModelInfo> models)
        Returns the most recent (regarding its version number) model out of the given set of models.
        Parameters:
        models - the models to search within
        Returns:
        the most recent model (may be null if models is empty)