/** * Generate SBE encoding and decoding stubs for a target language. * * @param ir for the parsed specification. * @param outputDirName directory into which code will be generated. * @param targetLanguage for the generated code. * @throws Exception if an error occurs while generating the code. */ public static void generate(final Ir ir, final String outputDirName, final String targetLanguage) throws Exception { final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader.get(targetLanguage); final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDirName); codeGenerator.generate(); } }
/** * Generate SBE encoding and decoding stubs for a target language. * * @param ir for the parsed specification. * @param outputDirName directory into which code will be generated. * @param targetLanguage for the generated code. * @throws Exception if an error occurs while generating the code. */ public static void generate(final Ir ir, final String outputDirName, final String targetLanguage) throws Exception { final TargetCodeGenerator targetCodeGenerator = TargetCodeGenerator.get(targetLanguage); final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDirName); codeGenerator.generate(); } }
/** * Do a case insensitive lookup of a target language for code generation. * * @param name of the target language to lookup. * @return the {@link TargetCodeGenerator} for the given language name. */ public static TargetCodeGenerator get(final String name) { for (final TargetCodeGenerator target : values()) { if (name.equalsIgnoreCase(target.name())) { return target; } } throw new IllegalArgumentException("No code generator for name: " + name); } }
/** * Generate SBE encoding and decoding stubs for a target language. * * @param ir for the parsed specification. * @param outputDirName directory into which code will be generated. * @param targetLanguage for the generated code. * @throws Exception if an error occurs while generating the code. */ public static void generate(final Ir ir, final String outputDirName, final String targetLanguage) throws Exception { final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader.get(targetLanguage); final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDirName); codeGenerator.generate(); } }
/** * Generate SBE encoding and decoding stubs for a target language. * * @param ir for the parsed specification. * @param outputDirName directory into which code will be generated. * @param targetLanguage for the generated code. * @throws Exception if an error occurs while generating the code. */ public static void generate(final Ir ir, final String outputDirName, final String targetLanguage) throws Exception { final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader.get(targetLanguage); final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDirName); codeGenerator.generate(); } }