All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.gdface.codegen.generic.GenericGenerator Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
package net.gdface.codegen.generic;

import org.apache.commons.cli.Options;

import net.gdface.cli.Context;
import net.gdface.codegen.generator.Generator;
import net.gdface.codegen.generator.GeneratorConfiguration;

public class GenericGenerator extends Generator {

	private final GenericInterfaceOptions options = GenericInterfaceOptions.getInstance();
	private final GenericInferfaceConfiguration config = new GenericInferfaceConfiguration();

	public GenericGenerator() {
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
	public Context createEngineContext() {
		GenericInterface newSourceInfo = new GenericInterface(config.getInterfaceClass(), config.getRefClass(), config.getShellInterface());
		if (!newSourceInfo.compile()){
			System.exit(1);
		}
		Context context = super.createEngineContext();
		context.setProperty(SOURCE_INFO, newSourceInfo);
		return context;
	}

	@Override
	protected Options getOptions() {
		return options.getOptions();
	}

	protected GeneratorConfiguration getGeneratorConfiguration() {
		return this.config;
	}

	public static void main(String[] args) {
		new GenericGenerator().parseCommandLine(args).initEngine().generate();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy