我创建了一个活动注释@Module,但我不希望生成的Java类用@Module注释。Xtend:在代码生成过程中删除活动注释
当我试图在转型阶段,除去注释,它来代替注释掉的注释(这将是罚款),但保留在进口是应该去掉注释
代码:
override doTransform(MutableClassDeclaration annotatedClass, extension TransformationContext context) {
annotatedClass.removeAnnotation(annotatedClass.annotations.findFirst[annotationTypeDeclaration == Module.newTypeReference.type])
}
生成类:
import my.package.Module;
/* @Module */@SuppressWarnings("all")
public class MyClass {}
的Xtend版本:2.11
XBASE LIB GWT版本:2.9.2
的Xtend Eclipse插件版本:2.11
同样的结果。还是)感谢你的建议。 – Stinky
有没有办法共享一个可重复的例子? –