Interface SModuleFacet

  • All Superinterfaces:
    DetachableFacet

    public interface SModuleFacet
    extends DetachableFacet
    Facets allow to store language or feature-specific settings on a module-level. Every facet has a language it is associated with. Facets are of different kind, each module may host at most one facet instance of each kind. All facets associated with the used languages in a module are automatically instantiated and added to the module. Facets persist their relevant settings using Memento which generally ends up in a module descriptor. NOTE, facets shall not depend on ModuleFacetDescriptor, their interface to outer world is bound to Memento only. For read-only modules, facets are not expected to change/persist settings.
    See Also:
    FacetsFacade
    • Method Detail

      • getModule

        @Nullable
        SModule getModule()
        Description copied from interface: DetachableFacet
        The owning module
        Specified by:
        getModule in interface DetachableFacet
        Returns:
        the module which is hosting this facet. it is allowed to be detached from the module, so null can be seen here.
      • save

        void save​(@NotNull
                  Memento memento)
        Gives the module facet the opportunity to persist into the supplied memento whatever configuration information may be needed to restore the models in the future.
      • load

        void load​(@NotNull
                  Memento memento)
        Allows the model root to read its previously saved configuration information
      • detach

        default void detach()
        Description copied from interface: DetachableFacet
        #getModule will return null after this invocation
        Specified by:
        detach in interface DetachableFacet