Class Generator
- java.lang.Object
-
- net.morimekta.providence.generator.Generator
-
public abstract class Generator extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Generator(FileManager manager)
-
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()
-
-
-
Constructor Detail
-
Generator
public Generator(FileManager manager)
-
-
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.
-
-