我正在尝试创建一个转换JUL日志语句的NetBeans提示模块:
LOG.log(Level.INFO, "Blah {0} Blah", param);
到Groovy日志语句:
log.info "Blah ${param} Blah"
我有提示,但我不知道如何使用org.netbeans.spi.java.hints.JavaFix
API执行转换:
@Override
protected void performRewrite(TransformationContext tc) {
WorkingCopy wc = tc.getWorkingCopy();
TreePath statementPath = tc.getPath();
//perform the required transformation ...
}