Package javassist.bytecode.annotation

Examples of javassist.bytecode.annotation.AnnotationMemberValue


            array[index] = val;
        }

        @Override
        public void visitAnnotationMemberValue(AnnotationMemberValue node) {
            array[index] = new AnnotationMemberValue(node.getValue(), constPool);
        }
View Full Code Here


                                for (Annotation annotation : items) {
                                    String typeName = annotation.getTypeName();
                                    if (typeName.equals(DirectCopyTransform.class.getName())) {
                                        ArrayMemberValue arrayMember = (ArrayMemberValue) annotation.getMemberValue("value");
                                        for (MemberValue arrayMemberValue : arrayMember.getValue()) {
                                            AnnotationMemberValue member = (AnnotationMemberValue) arrayMemberValue;
                                            Annotation memberAnnot = member.getValue();
                                            ArrayMemberValue annot = (ArrayMemberValue) memberAnnot.getMemberValue("templateTokens");
                                            for (MemberValue memberValue : annot.getValue()) {
                                                String val = ((StringMemberValue) memberValue).getValue();
                                                if (val != null && templateTokens.containsKey(val)) {
                                                    templateCheck: {
View Full Code Here

            EnumMemberValue e = new EnumMemberValue(cp);
            e.setType(type.getName());
            e.setValue(((Enum<?>) val).name());
            return e;
        } else if (type.isAnnotation()) {
            return new AnnotationMemberValue(createJavassistAnnotation((java.lang.annotation.Annotation) val, cp), cp);
        } else if (type.isArray()) {
            Class<?> arrayType = type.getComponentType();
            int length = Array.getLength(val);
            MemberValue arrayval = createEmptyMemberValue(arrayType, cp);
            ArrayMemberValue ret = new ArrayMemberValue(arrayval, cp);
View Full Code Here

        } else if (type.isEnum()) {
            EnumMemberValue e = new EnumMemberValue(cp);
            e.setType(type.getName());
            return e;
        } else if (type.isAnnotation()) {
            AnnotationMemberValue a = new AnnotationMemberValue(cp);
            return a;
        } else if (type.isArray()) {
            Class<?> arrayType = type.getComponentType();
            MemberValue arrayval = createEmptyMemberValue(arrayType, cp);
            ArrayMemberValue ret = new ArrayMemberValue(arrayval, cp);
View Full Code Here

      {
         CtClass annotation = pool.get(node.getIdentifier());
         javassist.bytecode.annotation.Annotation info = new javassist.bytecode.annotation.Annotation(cp, annotation);
         AnnotationInfoCreator creator = new AnnotationInfoCreator(pool, cp, info);
         node.childrenAccept(creator, data);
         AnnotationMemberValue mv = (AnnotationMemberValue) data;
         mv.setValue(info);
      }
      catch (NotFoundException e)
      {
         throw new RuntimeException(e)//To change body of catch statement use Options | File Templates.
      }
View Full Code Here

      this.cp = cp;
   }

   public void visitAnnotationMemberValue(AnnotationMemberValue annotationMemberValue)
   {
      value = new AnnotationMemberValue(cp);
   }
View Full Code Here

/*  55 */     this.cp = cp;
/*     */   }
/*     */
/*     */   public void visitAnnotationMemberValue(AnnotationMemberValue annotationMemberValue)
/*     */   {
/*  60 */     this.value = new AnnotationMemberValue(this.cp);
/*     */   }
View Full Code Here

/*     */     {
/* 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);
/*     */     }
/*     */     catch (NotFoundException e)
/*     */     {
/* 147 */       throw new RuntimeException(e);
/*     */     }
View Full Code Here

/*     */     }
/*     */
/*     */     int annotationMemberValue(int pos) throws Exception {
/* 597 */       Annotation anno = this.currentAnno;
/* 598 */       pos = super.annotationMemberValue(pos);
/* 599 */       this.currentMember = new AnnotationMemberValue(this.currentAnno, this.pool);
/* 600 */       this.currentAnno = anno;
/* 601 */       return pos;
/*     */     }
View Full Code Here

      {
         CtClass annotation = pool.get(node.getIdentifier());
         javassist.bytecode.annotation.Annotation info = new javassist.bytecode.annotation.Annotation(cp, annotation);
         AnnotationInfoCreator creator = new AnnotationInfoCreator(pool, cp, info);
         node.childrenAccept(creator, data);
         AnnotationMemberValue mv = (AnnotationMemberValue) data;
         mv.setValue(info);
      }
      catch (NotFoundException e)
      {
         throw new RuntimeException(e)//To change body of catch statement use Options | File Templates.
      }
View Full Code Here

TOP

Related Classes of javassist.bytecode.annotation.AnnotationMemberValue

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.