Class Generator


  • public abstract class Generator
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void generate​(net.morimekta.providence.reflect.ProgramRegistry registry)
      Each compiler must implement this method.
      void generateGlobal​(net.morimekta.providence.reflect.GlobalRegistry registry, java.util.Collection<java.nio.file.Path> inputFiles)
      Generate anything that is dependent on the global scope, or not directly connected to a single program.
      protected FileManager getFileManager()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getFileManager

        protected final FileManager getFileManager()
        Returns:
        The local file manager.
      • generate

        public abstract void generate​(net.morimekta.providence.reflect.ProgramRegistry registry)
                               throws java.io.IOException,
                                      GeneratorException
        Each compiler must implement this method.
        Parameters:
        registry - The typed and scoped registry for the program.
        Throws:
        java.io.IOException - If a file could not be written.
        GeneratorException - If some part of the file code could not be generated (invalid content).
      • generateGlobal

        public void generateGlobal​(net.morimekta.providence.reflect.GlobalRegistry registry,
                                   java.util.Collection<java.nio.file.Path> inputFiles)
                            throws java.io.IOException,
                                   GeneratorException
        Generate anything that is dependent on the global scope, or not directly connected to a single program.
        Parameters:
        registry - The global program registry.
        inputFiles - List of files that are generated for.
        Throws:
        java.io.IOException - If writing files failed.
        GeneratorException - If bad generation.