Class NextGen

java.lang.Object
de.spraener.nxtgen.NextGen
All Implemented Interfaces:
Runnable

public class NextGen extends Object implements Runnable
The begining of all the hacks...

NextGen is started with a simple parameter, the URI of a Model-File.

It starts to locate (with the ServiceLoader-Machanism) a implementation of ModelLoader and asks each of them if it can handel a model with the given URI. Typically there is only one ModelLoader, that can handle the given model URI.

After that it loads all Cartridges (again ServiceLoader).

Each Cartridge is called with a new instance M of the model laoded by the ModelLoader After that the Transformations of the Cartridge are startet. This results in an enhanced Model M'.

After that the Cartridge has to map Generators to ModelElements on the model M'.

If that mapping is done, NextGen will start the generation for each mapped ModelElement.

The result of a generation call is a CodeBlock. CodeBlocks can contain Java, TypsScript,XML, YAML... whatever your application needs.

Each CodeBlock is than given to the Cartridge to write the content into your project.

  • Field Details

    • LOGGER

      public static final Logger LOGGER
  • Method Details

    • setWorkingDir

      public static void setWorkingDir(String workingDir)
    • getProtectionStrategie

      public static ProtectionStrategie getProtectionStrategie()
    • runCartridgeWithName

      public static void runCartridgeWithName(String cartridgeName)
    • addCartridge

      public static void addCartridge(Cartridge c)
    • addModelLoader

      public static void addModelLoader(ModelLoader ml)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getWorkingDir

      public static String getWorkingDir()
    • setActiveLoader

      public static void setActiveLoader(ModelLoader loader)
    • getActiveLoader

      public static ModelLoader getActiveLoader()
    • main

      public static void main(String[] args)