Commit bb212b7b by s_guodong

修改注解增强

parent 74414af5
......@@ -58,11 +58,9 @@ public class ModuleAnnotationTranslator extends TreeTranslator {
AbstractAnnotationEnhance annotationEnhance = new ModuleSetterEnhance();
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it);
}
if (needGenerateMethod(annotations, TDGetter.class.getName()) && isValidField(it)) {
AbstractAnnotationEnhance annotationEnhance = new ModuleGetterEnhance();
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it);
}
if (needGenerateMethod(annotations, BDGetter.class.getName()) && isValidField(it)) {
if ((needGenerateMethod(annotations, TDGetter.class.getName()) ||
needGenerateMethod(annotations, BDGetter.class.getName())) &&
isValidField(it)) {
AbstractAnnotationEnhance annotationEnhance = new ModuleGetterEnhance();
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it);
}
......
......@@ -66,26 +66,6 @@ public class BDGetterEnhance extends AbstractAnnotationEnhance {
.append(treeMaker.Select(treeMaker.Ident(names.fromString(tClass)), names.fromString("class")))
.toList(),
null);
} else if (variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("IPanel"))
|| variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("PanelImpl"))) {
String i18n = AnnotationEnhanceUtils.findAnnotationArguments(args, "i18n", "").replaceAll("\"", "");
jcNewClass = treeMaker.NewClass(null,
com.sun.tools.javac.util.List.nil(),
treeMaker.Ident(names.fromString("PanelImpl")),
new ListBuffer<JCTree.JCExpression>()
.append(treeMaker.Literal(variableDecl.name.toString()))
.append(treeMaker.Apply(
com.sun.tools.javac.util.List.nil(),
treeMaker.Select(treeMaker.Ident(names.fromString("MdaUtils")), names.fromString("getI18NString")),
new ListBuffer<JCTree.JCExpression>()
.append(treeMaker.Ident(names.fromString("this")))
.append(treeMaker.Literal(TypeTag.CLASS, i18n))
.toList()
))
.append(treeMaker.Ident(names.fromString("this")))
.toList(),
null);
} else if (variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("IStream"))
|| variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("StreamImpl"))) {
jcNewClass = treeMaker.NewClass(null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment