Enum SDependencyScope

  • All Implemented Interfaces:
    Serializable, Comparable<SDependencyScope>

    public enum SDependencyScope
    extends Enum<SDependencyScope>
    There are several types of dependencies between two modules.
    • DEFAULT - the dependency is resolved and is available on the classpath during the code generation, compilation and run phases
    • DESIGN - the dependency between models that has effect only during editing and is removed during generation
    • COMPILE - the dependency is resolved and is available on the classpath during the compilation and run phases
    • RUNTIME - the dependency is only required when running the application, and should not be available on the classpath during compilation
    • PROVIDED - the dependency is resolved and is available on the classpath during code generation and compilation, but is not included on the classpath at runtime. This dependency scope is useful, when you have some container that provides the dependency at runtime.
    • EXTENDS - the dependency between two languages that further enhances the DEFAULT dependency by allowing language extension
    • GENERATES_INTO - the dependency between languages that indicates that he source language will be generated into the target language and thus the generated code needs the dependencies of the target language.
    • Enum Constant Detail

      • DESIGN

        public static final SDependencyScope DESIGN
        DESIGN dependency between generators indicates there's no run-time bound between the two. Unlike DEFAULT and EXTENDS, which require target generator to be available at generation time, DESIGN dependency serves primarily the purpose to declare priorities between generator without actually enforcing inclusion of all dependant generators into generation process.
      • EXTENDS

        public static final SDependencyScope EXTENDS
        Applicable between either two language or two generator modules
      • GENERATES_INTO

        public static final SDependencyScope GENERATES_INTO
        GENERATES_INTO indicates target languages this language's generators produce. Effectively this mandates use of run-time dependencies of these target languages when models use dependant language. Applicable between two language modules only. HOWEVER, we shall consider to have this dependency for generator, either as user-controlled way to state which languages generator uses for templates, or as a derived value based on generator's own description of target languages. We need to state these languages anyway (instead of present approach to calculate them with TemplateModelScanner) and we might collect these in addition to generator source language's GENERATES_INTO dependencies. Note, present approach would change once generators are separate from the language, and multiple generators are possible - provided each generator may target different languages, would be stupid to specify complete set of dependant runtimes with the source language. Given L1 and L2, with L1 GENERATES_INTO L2, L2 with run-time solution S2, and model M1 using L1, the dependency tells to include S2 of L2 as a runtime dependency for M1 outcome.
    • Method Detail

      • values

        public static SDependencyScope[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SDependencyScope c : SDependencyScope.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SDependencyScope valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • identify

        @NotNull
        public String identify()
        scope to string
        Returns:
        identity one may use to persist the scope