Class DefaultSModelDescriptor

    • Method Detail

      • replace

        public void replace​(SModelData modelData)
      • shouldCorrectModelRef

        protected boolean shouldCorrectModelRef()
      • getPersistenceVersion

        public int getPersistenceVersion()
        Since we expose persistence aspects of a model from (openapi)SModel, it's reasonable to keep persistence attributes we are not yet ready to expose here in the implementation. These attributes shall not be part of SModelData (smodel.SModel), which is purely about nodes and model structure. To me, persistence shall be completely independent aspect, not exposed from SModel, however, at this moment the best we could do is to keep persistence within SModel descriptor and hope for the future changes (deprecate and remove methods like getDataSource, getProblems)
        Specified by:
        getPersistenceVersion in interface PersistenceVersionAware
        Returns:
        actual persistence version number of loaded/created model, or -1 if persistence versioning is not supported
      • setPersistenceVersion

        public void setPersistenceVersion​(int persistenceVersion)
        Description copied from interface: PersistenceVersionAware
        Indicated persistence version for model serialization
        Specified by:
        setPersistenceVersion in interface PersistenceVersionAware
        Parameters:
        persistenceVersion - persistence version number, or -1 for undefined/unknown
      • isGeneratable

        public boolean isGeneratable()
        Description copied from interface: GeneratableSModel
        Generally, doNotGenerate is a primary reason to generate (or not) the model. However, if there's more than a simple option, this method gives a chance to control "to generate, or not to generate".
        Specified by:
        isGeneratable in interface GeneratableSModel
        Returns:
        true if the model can serve as generator input
      • setGenerateIntoModelFolder

        public void setGenerateIntoModelFolder​(boolean value)
        Description copied from interface: GeneratableSModel
        PROVISIONAL API. Likely to cease once there's better mechanism to override output directory than #isGenerateIntoModelFolder Update the value of generateIntoModelFolder attribute
        Specified by:
        setGenerateIntoModelFolder in interface GeneratableSModel
      • forEach

        public void forEach​(@NotNull
                            BiConsumer<String,​String> action)
        Description copied from interface: ModelWithAttributes
        Iterate over all available attributes. Generally, not present attributes are not reported, however, clients shall expect null values, and implementation may report missing/deleted attributes. For now, the contract is action shall not modify attributes, we might relax this in future (i.e. iterate over a copy of internal storage), if there are scenarios we find it handy.
        Specified by:
        forEach in interface ModelWithAttributes
        Parameters:
        action - action to perform for each key-value attribute pair