Package javassist.bytecode.annotation

Examples of javassist.bytecode.annotation.Annotation


      theField.setModifiers( theField.getModifiers() | Modifier.TRANSIENT );
    }
    theField.setModifiers( Modifier.setPrivate( theField.getModifiers() ) );

    final AnnotationsAttribute annotationsAttribute = getVisibleAnnotations( theField.getFieldInfo() );
    annotationsAttribute.addAnnotation( new Annotation( Transient.class.getName(), constPool ) );
    return theField;
  }
View Full Code Here


         boolean changed = false;
         for (int i = 0; i < annotations.length; i++)
         {
            if (annotations[i].getTypeName().equals(Inherited.class.getName()))
            {
               annotations[i] = new Annotation("org/jboss/lang/annotation/Inherited", file.getConstPool());
               changed = true;
            }
         }
         if (changed)
         {
View Full Code Here

/*     */
/*     */   public void visitAnnotationMemberValue(AnnotationMemberValue node)
/*     */   {
/*     */     try
/*     */     {
/*  71 */       Annotation ann = node.getValue();
/*  72 */       this.value = AnnotationProxy.createProxy(ann);
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/*  76 */       throw new RuntimeException(e);
View Full Code Here

/*    */
/*    */   public static String getAspectDomain(AnnotationsAttribute visible, String defaultContainerName)
/*    */   {
/* 71 */     if (visible != null)
/*    */     {
/* 73 */       Annotation dinfo = visible.getAnnotation(AspectDomain.class.getName());
/*    */
/* 75 */       if (dinfo != null)
/*    */       {
/* 77 */         StringMemberValue dmv = (StringMemberValue)dinfo.getMemberValue("value");
/*    */
/* 79 */         if (dmv != null)
/*    */         {
/* 81 */           return dmv.getValue();
/*    */         }
View Full Code Here

/* 193 */     for (int i = 0; i < clazz.getTags().length; i++)
/*     */     {
/* 195 */       AnnotationDocletTag tag = (AnnotationDocletTag)clazz.getTags()[i];
/* 196 */       if (tag.getAnnotation() != null) {
/* 197 */         modified = true;
/* 198 */         Annotation info = AnnotationInfoCreator.createAnnotationInfo(this.pool, ctClass.getClassFile().getConstPool(), tag.getAnnotation());
/* 199 */         AnnotationsAttribute visible = getVisibleAnnotationsAttribute(ctClass);
/* 200 */         visible.addAnnotation(info);
/* 201 */         visible.getAnnotations();
/*     */       }
/*     */     }
View Full Code Here

/*     */
/*     */   private void compileMethod(JavaMethod method, AnnotationDocletTag tag, CtClass clazz) throws Exception
/*     */   {
/* 283 */     CtMethod ctMethod = getJavassistMethod(method, clazz);
/* 284 */     MethodInfo minfo = ctMethod.getMethodInfo();
/* 285 */     Annotation info = AnnotationInfoCreator.createAnnotationInfo(this.pool, minfo.getConstPool(), tag.getAnnotation());
/* 286 */     AnnotationsAttribute visible = (AnnotationsAttribute)minfo.getAttribute("RuntimeVisibleAnnotations");
/* 287 */     if (visible == null)
/*     */     {
/* 289 */       visible = new AnnotationsAttribute(minfo.getConstPool(), "RuntimeVisibleAnnotations");
/* 290 */       minfo.addAttribute(visible);
View Full Code Here

/*     */   private void compileField(JavaField field, AnnotationDocletTag tag, CtClass clazz)
/*     */     throws Exception
/*     */   {
/* 298 */     CtField ctField = clazz.getDeclaredField(field.getName());
/* 299 */     FieldInfo minfo = ctField.getFieldInfo();
/* 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);
View Full Code Here

/*     */
/*     */   private void compileConstructor(JavaMethod method, AnnotationDocletTag tag, CtClass clazz, boolean isInnerClass) throws Exception
/*     */   {
/* 312 */     CtConstructor ctMethod = getJavassistConstructor(method, clazz, isInnerClass);
/* 313 */     MethodInfo minfo = ctMethod.getMethodInfo();
/* 314 */     Annotation info = AnnotationInfoCreator.createAnnotationInfo(this.pool, minfo.getConstPool(), tag.getAnnotation());
/* 315 */     AnnotationsAttribute visible = (AnnotationsAttribute)minfo.getAttribute("RuntimeVisibleAnnotations");
/* 316 */     if (visible == null)
/*     */     {
/* 318 */       visible = new AnnotationsAttribute(minfo.getConstPool(), "RuntimeVisibleAnnotations");
/* 319 */       minfo.addAttribute(visible);
View Full Code Here

/*     */   }
/*     */
/*     */   protected static Object create(AnnotationsAttribute group, Class annotation) throws Exception
/*     */   {
/* 280 */     if (group == null) return null;
/* 281 */     Annotation info = group.getAnnotation(annotation.getName());
/* 282 */     if (info == null) return null;
/* 283 */     return AnnotationProxy.createProxy(info, annotation);
/*     */   }
View Full Code Here

/*     */   public Object visit(ASTAnnotation node, Object data)
/*     */   {
/*     */     try
/*     */     {
/* 138 */       CtClass annotation = this.pool.get(node.getIdentifier());
/* 139 */       Annotation info = new Annotation(this.cp, annotation);
/* 140 */       AnnotationInfoCreator creator = new AnnotationInfoCreator(this.pool, this.cp, info);
/* 141 */       node.childrenAccept(creator, data);
/* 142 */       AnnotationMemberValue mv = (AnnotationMemberValue)data;
/* 143 */       mv.setValue(info);
/*     */     }
View Full Code Here

TOP

Related Classes of javassist.bytecode.annotation.Annotation

Copyright © 2018 www.massapicom. 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.