Class AbstractResolvableModel<V extends IMetaParameterDeclaration,​M extends IModel>

    • Field Detail

      • dirty

        private transient boolean dirty
      • advices

        private Advice[] advices
      • typedefs

        private java.util.List<Typedef> typedefs
      • compounds

        private java.util.List<Compound> compounds
    • Constructor Detail

      • AbstractResolvableModel

        protected AbstractResolvableModel​(Imports<M> imports,
                                          TypeRegistry registry,
                                          Advice[] advices)
        Creates an abstract resolvable model.
        Parameters:
        imports - the imports
        registry - the registry which is responsible for this type
        advices - the advices (may be null)
    • Method Detail

      • processModelListeners

        private void processModelListeners​(boolean add)
        Processes the model listeners for the advices.
        Parameters:
        add - add or remove the model listeners
      • getImportsCount

        public int getImportsCount()
        Description copied from interface: IModel
        Returns the number of imports.
        Specified by:
        getImportsCount in interface IModel
        Returns:
        the number of imports
      • getImport

        public ModelImport<M> getImport​(int index)
        Description copied from interface: IModel
        Returns the model import specified by index.
        Specified by:
        getImport in interface IModel
        Parameters:
        index - a 0-based index specifying the import to be returned
        Returns:
        the model import
      • createImports

        protected Imports<M> createImports()
        Creates an empty imports instance (in case that a specialized instance shall be used).
        Returns:
        the created instance
      • addImport

        public void addImport​(ModelImport<M> imp)
        Add a project import to this model.
        Parameters:
        imp - The additional project import.
      • getImports

        protected Imports<M> getImports()
        Returns the imports instance.
        Returns:
        the imports instance
      • getAdviceCount

        public int getAdviceCount()
        Get the number of advices of this model.
        Returns:
        The number of advices of this model.
      • getAdvice

        public Advice getAdvice​(int index)
        Get the advice at the specified index.
        Parameters:
        index - The 0-based index of the advice to be returned.
        Returns:
        The advice parameter at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >=getAdviceCount()
      • dispose

        public void dispose()
        Description copied from interface: IModel
        Shall be called at the end of the lifetime of the model in order to clean up references such as listeners.
        Specified by:
        dispose in interface IModel
      • isDirty

        public boolean isDirty()
        Returns whether this model has become dirty, e.g., due to updates of the underlying adviced models.
        Returns:
        true if this model has become dirty and shall be at least reloaded before execution, false else
      • notifyReplaced

        public void notifyReplaced​(Project oldModel,
                                   Project newModel)
        Description copied from interface: IModelListener
        Is called to notify that oldModel is replaced by newModel. The listener registrations for oldModel will be adjusted accordingly.
        Do not modify the the listeners of oldModel or newModel during this method.
        Specified by:
        notifyReplaced in interface IModelListener<V extends IMetaParameterDeclaration>
        Parameters:
        oldModel - the old model being replaced
        newModel - the new model (the replacement)
      • getIvmlElement

        public java.lang.Object getIvmlElement​(java.lang.String name)
        Description copied from interface: IResolvableModel
        Returns whether the given name resolves to an IVML element.
        Specified by:
        getIvmlElement in interface IResolvableModel<V extends IMetaParameterDeclaration,​M extends IModel>
        Parameters:
        name - the name to be resolved
        Returns:
        the IVML element (value, containable model element), null else
      • reload

        protected abstract void reload()
        Causes a reload of this model.