Package javassist.bytecode

Examples of javassist.bytecode.ClassFile.addAttribute()


    static Class<?> createAnnotationsProxy(ClassLoader loader, AnnotationsAttribute annotations) {
        String proxyName = ProxyDefinitionStore.getProxyName();
        ClassFile proxy = new ClassFile(false, proxyName, "java.lang.Object");
        proxy.setAccessFlags(AccessFlag.PUBLIC);
        AttributeInfo a = annotations.copy(proxy.getConstPool(), Collections.EMPTY_MAP);
        proxy.addAttribute(a);
        try {
            ByteArrayOutputStream bytes = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(bytes);
            try {
                proxy.write(dos);
View Full Code Here


    // Replace annotation
    annoAttr.addAnnotation(a);

    // Replace annotation attribute
    classFile.addAttribute(annoAttr);
  }

  /**
   * Enhance resource meta data
   */
 
View Full Code Here

    // Replace annotation
    annoAttr.addAnnotation(a);

    // Replace annotation attribute
    classFile.addAttribute(annoAttr);
  }

  /**
   * Set a annotation member value if no value is present, if the present value is the default
   * generated by uimaFIT or if a override is active.
View Full Code Here

      ClassFile destFile = dest.getClassFile2();
     
      SignatureAttribute sig = (SignatureAttribute)srcFile.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destFile.addAttribute(sig.copy(destFile.getConstPool(), EMPTY_HASHMAP));
      }
   }

   private interface ProxyStrategy
   {
View Full Code Here

            cf.addAttribute(ica);
        }

        ica.append(c.getName(), this.getName(), name,
                   (cf2.getAccessFlags() & ~AccessFlag.SUPER) | AccessFlag.STATIC);
        cf2.addAttribute(ica.copy(cf2.getConstPool(), null));
        return c;
    }

    /* flush cached names.
     */
 
View Full Code Here

    }

    public void setAttribute(String name, byte[] data) {
        checkModify();
        ClassFile cf = getClassFile2();
        cf.addAttribute(new AttributeInfo(cf.getConstPool(), name, data));
    }

    public void instrument(CodeConverter converter)
        throws CannotCompileException
    {
View Full Code Here

      AnnotationsAttribute visible = (AnnotationsAttribute) ctClass.getClassFile().getAttribute(AnnotationsAttribute.visibleTag);
      if (visible == null)
      {
         ClassFile cf = ctClass.getClassFile();
         visible = new AnnotationsAttribute(cf.getConstPool(), AnnotationsAttribute.visibleTag);
         cf.addAttribute(visible);
      }
      return visible;
   }

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

      ClassFile destFile = dest.getClassFile2();
     
      SignatureAttribute sig = (SignatureAttribute)srcFile.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destFile.addAttribute(sig.copy(destFile.getConstPool(), EMPTY_HASHMAP));
      }
   }

   private interface ProxyStrategy
   {
View Full Code Here

      ClassFile destFile = dest.getClassFile2();
     
      SignatureAttribute sig = (SignatureAttribute)srcFile.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destFile.addAttribute(sig.copy(destFile.getConstPool(), EMPTY_HASHMAP));
      }
   }

   private interface ProxyStrategy
   {
View Full Code Here

            cf.addAttribute(ica);
        }

        ica.append(c.getName(), this.getName(), name,
                   (cf2.getAccessFlags() & ~AccessFlag.SUPER) | AccessFlag.STATIC);
        cf2.addAttribute(ica.copy(cf2.getConstPool(), null));
        return c;
    }

    public CtField[] getFields() {
        ArrayList alist = new ArrayList();
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.