Пример #1
0
 @Override
 public FField annotation(String annotationPath, StringKVal... memberValues) {
   // TODO Auto-generated method stub
   if (!this.flushed) {
     this.flush();
   }
   this.fieldInfo.addAttribute(ClassUtil.buildAnnotation(this.cp, annotationPath, memberValues));
   return this;
 }
Пример #2
0
 @Override
 public FField flush() {
   // TODO Auto-generated method stub
   this.field =
       ClassUtil.buildField(
           this.source, this.type, this.name, this.isPublic, this.isStatic, this.isFinal);
   if (withGetter) {
     ClassUtil.addGetter(this.source, this.field, this.name);
   }
   if (withSetter) {
     ClassUtil.addSetter(this.source, this.field, this.name);
   }
   try {
     this.source.addField(this.field);
   } catch (CannotCompileException e) {
     // TODO Auto-generated catch block
     throw new RuntimeException(e);
   }
   this.fieldInfo = this.field.getFieldInfo();
   this.cp = this.fieldInfo.getConstPool();
   this.flushed = true;
   return this;
 }