Package javassist.bytecode

Examples of javassist.bytecode.FieldInfo.addAttribute()


/*     */   public static void addSignature(CtField field, String signature)
/*     */   {
/*  72 */     FieldInfo fieldInfo = field.getFieldInfo();
/*  73 */     ConstPool constPool = fieldInfo.getConstPool();
/*  74 */     SignatureAttribute signatureAttribute = new SignatureAttribute(constPool, signature);
/*  75 */     fieldInfo.addAttribute(signatureAttribute);
/*     */   }
/*     */
/*     */   public static void addSignature(CtMethod method, String signature)
/*     */   {
/*  80 */     MethodInfo methodInfo = method.getMethodInfo();
View Full Code Here


/* 300 */     Annotation info = AnnotationInfoCreator.createAnnotationInfo(this.pool, minfo.getConstPool(), tag.getAnnotation());
/* 301 */     AnnotationsAttribute visible = (AnnotationsAttribute)minfo.getAttribute("RuntimeVisibleAnnotations");
/* 302 */     if (visible == null)
/*     */     {
/* 304 */       visible = new AnnotationsAttribute(minfo.getConstPool(), "RuntimeVisibleAnnotations");
/* 305 */       minfo.addAttribute(visible);
/*     */     }
/* 307 */     visible.addAnnotation(info);
/*     */   }
/*     */
/*     */   private void compileConstructor(JavaMethod method, AnnotationDocletTag tag, CtClass clazz, boolean isInnerClass) throws Exception
View Full Code Here

               {
                  AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
                  if (invisible == null)
                  {
                     invisible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.invisibleTag);
                     mi.addAttribute(invisible);
                  }
                  changed = true;
                  invisible.addAnnotation(info);
               }
               else
View Full Code Here

               {
                  AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
                  if (visible == null)
                  {
                     visible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.visibleTag);
                     mi.addAttribute(visible);
                  }
                  changed = true;
                  visible.addAnnotation(info);
               }
            }
View Full Code Here

      javassist.bytecode.annotation.Annotation info = AnnotationInfoCreator.createAnnotationInfo(pool, minfo.getConstPool(), tag.getAnnotation());
      AnnotationsAttribute visible = (AnnotationsAttribute) minfo.getAttribute(AnnotationsAttribute.visibleTag);
      if (visible == null)
      {
         visible = new AnnotationsAttribute(minfo.getConstPool(), AnnotationsAttribute.visibleTag);
         minfo.addAttribute(visible);
      }
      visible.addAnnotation(info);
   }

   private void compileConstructor(JavaMethod method, AnnotationDocletTag tag, CtClass clazz, boolean isInnerClass) throws Exception
View Full Code Here

/*   87 */     FieldInfo fi = this.fieldInfo;
/*   88 */     fi.setAccessFlags(src.fieldInfo.getAccessFlags());
/*   89 */     ConstPool cp = fi.getConstPool();
/*   90 */     while (iterator.hasNext()) {
/*   91 */       AttributeInfo ainfo = (AttributeInfo)iterator.next();
/*   92 */       fi.addAttribute(ainfo.copy(cp, null));
/*      */     }
/*      */   }
/*      */
/*      */   private CtField(String typeDesc, String name, CtClass clazz)
/*      */     throws CannotCompileException
View Full Code Here

      FieldInfo fieldInfo = field.getFieldInfo();
      AnnotationsAttribute attribute = (AnnotationsAttribute) fieldInfo.getAttribute(AnnotationsAttribute.visibleTag);
      if (attribute == null)
         attribute = new AnnotationsAttribute(fieldInfo.getConstPool(), AnnotationsAttribute.visibleTag);
      attribute.addAnnotation(annotation);
      fieldInfo.addAttribute(attribute);
   }

   public static void addClassAnnotation(CtClass clazz, javassist.bytecode.annotation.Annotation annotation)
   {
      ClassFile classFile = clazz.getClassFile();
View Full Code Here

   public static void addSignature(CtField field, String signature)
   {
      FieldInfo fieldInfo = field.getFieldInfo();
      ConstPool constPool = fieldInfo.getConstPool();
      SignatureAttribute signatureAttribute = new SignatureAttribute(constPool, signature);
      fieldInfo.addAttribute(signatureAttribute);
   }

   public static void addSignature(CtMethod method, String signature)
   {
      MethodInfo methodInfo = method.getMethodInfo();
View Full Code Here

               {
                  AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
                  if (invisible == null)
                  {
                     invisible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.invisibleTag);
                     mi.addAttribute(invisible);
                  }
                  changed = true;
                  invisible.addAnnotation(info);
               }
               else
View Full Code Here

               {
                  AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
                  if (visible == null)
                  {
                     visible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.visibleTag);
                     mi.addAttribute(visible);
                  }
                  changed = true;
                  visible.addAnnotation(info);
               }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.