示例#1
0
 void addAnnotation(boolean visible, String clname) throws jasError {
   if (cur_method != null) {
     cur_annotation = cur_method.addAnnotation(visible, clname);
   } else if (cur_field != null) {
     cur_annotation = cur_field.addAnnotation(visible, clname);
   } else if (class_header) {
     cur_annotation = class_env.addAnnotation(visible, clname);
   } else {
     outside(".annotation");
   }
 }
示例#2
0
 //
 // called by the .deprecated directive
 //
 //
 void setDeprecated() throws jasError {
   DeprecatedAttr depr = new DeprecatedAttr();
   if (cur_method != null) {
     cur_method.setDeprecated(depr);
   } else if (cur_field != null) {
     cur_field.setDeprecated(depr);
   } else if (class_header) {
     class_env.setDeprecated(depr);
   } else {
     outside(".deprecated");
   }
 }
示例#3
0
 //
 // called by the .signature directive
 //
 void setSignature(String str) throws jasError {
   SignatureAttr sig = new SignatureAttr(str);
   if (cur_method != null) {
     cur_method.setSignature(sig);
   } else if (cur_field != null) {
     cur_field.setSignature(sig);
   } else if (class_header) {
     class_env.setSignature(str);
   } else {
     outside(".signature");
   }
 }
示例#4
0
 //
 // called by the .attribute directive
 //
 void addGenericAttr(String name, String file) throws IOException, jasError {
   GenericAttr gattr = new GenericAttr(name, file);
   if (cur_method != null) {
     flushInsnBuffer();
     if (code != null) code.addGenericAttr(gattr);
     else cur_method.addGenericAttr(gattr);
   } else if (cur_field != null) {
     cur_field.addGenericAttr(gattr);
   } else if (class_header) {
     class_env.addGenericAttr(gattr);
   } else {
     outside(".attribute");
   }
 }
示例#5
0
 //
 // called by the .field directive
 //
 void addField(short access, String name, String desc, String sig, Object value) throws jasError {
   beginField(access, name, desc, value);
   if (sig != null) cur_field.setSignature(new SignatureAttr(sig));
   endField();
 }