2017-02-16 14 views
0

활성 주석 @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 이클립스 플러그인 버전 : 2.11

답변

0

Java 8로 업그레이드 했으므로 이제 주석 제거 코드가 작동합니다.

0

당신이 Module.findTypeGlobally 대신 Module.newTypeReference.type으로 시도 수 있을까요?

+0

같은 결과입니다. 그래도 제안을 주셔서 감사합니다. – Stinky

+0

재현 가능한 예제를 공유하는 방법이 있습니까? –