/** * Runs the DML compiler * * This is the main entry point for, programmatically, running the DML compiler. The compiler * will first create the domain model, and then run the code generator. * * @param compArgs All the compiler's parameters * @return The {@link DomainModel} * * @see CompilerArgs */ public static DomainModel compile(CompilerArgs compArgs) throws DmlCompilerException { try { DomainModel model = getDomainModel(compArgs); CodeGenerator generator = compArgs.getCodeGenerator().getConstructor(CompilerArgs.class, DomainModel.class) .newInstance(compArgs, model); generator.generateCode(); return model; } catch (Exception e) { throw new DmlCompilerException(e); } }