Commit bb212b7b by s_guodong

修改注解增强

parent 74414af5
...@@ -58,11 +58,9 @@ public class ModuleAnnotationTranslator extends TreeTranslator { ...@@ -58,11 +58,9 @@ public class ModuleAnnotationTranslator extends TreeTranslator {
AbstractAnnotationEnhance annotationEnhance = new ModuleSetterEnhance(); AbstractAnnotationEnhance annotationEnhance = new ModuleSetterEnhance();
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it); processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it);
} }
if (needGenerateMethod(annotations, TDGetter.class.getName()) && isValidField(it)) { if ((needGenerateMethod(annotations, TDGetter.class.getName()) ||
AbstractAnnotationEnhance annotationEnhance = new ModuleGetterEnhance(); needGenerateMethod(annotations, BDGetter.class.getName())) &&
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it); isValidField(it)) {
}
if (needGenerateMethod(annotations, BDGetter.class.getName()) && isValidField(it)) {
AbstractAnnotationEnhance annotationEnhance = new ModuleGetterEnhance(); AbstractAnnotationEnhance annotationEnhance = new ModuleGetterEnhance();
processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it); processAnnotationEnhance(annotationEnhance, null, jcClassDecl, it);
} }
......
...@@ -66,26 +66,6 @@ public class BDGetterEnhance extends AbstractAnnotationEnhance { ...@@ -66,26 +66,6 @@ public class BDGetterEnhance extends AbstractAnnotationEnhance {
.append(treeMaker.Select(treeMaker.Ident(names.fromString(tClass)), names.fromString("class"))) .append(treeMaker.Select(treeMaker.Ident(names.fromString(tClass)), names.fromString("class")))
.toList(), .toList(),
null); 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")) } else if (variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("IStream"))
|| variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("StreamImpl"))) { || variableDecl.vartype.type.toString().equals(moduleClassNameProperties.get("StreamImpl"))) {
jcNewClass = treeMaker.NewClass(null, 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