use of io.vertx.codetrans.lang.groovy.GroovyLang in project vertx-examples by vert-x3.
the class CodeTransProcessor method init.
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
String outputOption = processingEnv.getOptions().get("codetrans.output");
if (outputOption != null) {
outputDir = new File(outputOption);
}
translator = new CodeTranslator(processingEnv);
langs = Arrays.asList(new JavaScriptLang(), new GroovyLang(), new RubyLang());
String configFile = processingEnv.getOptions().get("codetrans.config");
if (configFile != null) {
ObjectMapper mapper = new ObjectMapper().enable(JsonParser.Feature.ALLOW_COMMENTS).enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
File file = new File(configFile);
try {
config = (ObjectNode) mapper.readTree(file);
} catch (IOException e) {
System.err.println("[ERROR] Cannot read configuration file " + file.getAbsolutePath() + " : " + e.getMessage());
e.printStackTrace();
}
}
}
Aggregations