Package javassist.bytecode.annotation

Examples of javassist.bytecode.annotation.AnnotationsWriter


     * @param value         the new value.
     * @see javassist.bytecode.annotation.Annotation#createMemberValue(ConstPool, CtClass)
     */
    public void setDefaultValue(MemberValue value) {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
        try {
            value.write(writer);
            writer.close();
        }
        catch (IOException e) {
            throw new RuntimeException(e);      // should never reach here.
        }

View Full Code Here


     * @param value         the new value.
     * @see javassist.bytecode.annotation.Annotation#createMemberValue(ConstPool, CtClass)
     */
    public void setDefaultValue(MemberValue value) {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
        try {
            value.write(writer);
            writer.close();
        }
        catch (IOException e) {
            throw new RuntimeException(e);      // should never reach here.
        }

View Full Code Here

     * @param value         the new value.
     * @see javassist.bytecode.annotation.Annotation#createMemberValue(ConstPool, CtClass)
     */
    public void setDefaultValue(MemberValue value) {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
        try {
            value.write(writer);
            writer.close();
        }
        catch (IOException e) {
            throw new RuntimeException(e);      // should never reach here.
        }

View Full Code Here

/*     */   }
/*     */
/*     */   public void setAnnotations(Annotation[] annotations)
/*     */   {
/* 240 */     ByteArrayOutputStream output = new ByteArrayOutputStream();
/* 241 */     AnnotationsWriter writer = new AnnotationsWriter(output, this.constPool);
/*     */     try {
/* 243 */       int n = annotations.length;
/* 244 */       writer.numAnnotations(n);
/* 245 */       for (int i = 0; i < n; i++) {
/* 246 */         annotations[i].write(writer);
/*     */       }
/* 248 */       writer.close();
/*     */     }
/*     */     catch (IOException e) {
/* 251 */       throw new RuntimeException(e);
/*     */     }
/*     */
View Full Code Here

/*     */
/*     */     Copier(byte[] info, ConstPool src, ConstPool dest, Map map)
/*     */     {
/* 404 */       super();
/* 405 */       this.output = new ByteArrayOutputStream();
/* 406 */       this.writer = new AnnotationsWriter(this.output, dest);
/* 407 */       this.srcPool = src;
/* 408 */       this.destPool = dest;
/* 409 */       this.classnames = map;
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   public void setAnnotations(Annotation[][] params)
/*     */   {
/* 147 */     ByteArrayOutputStream output = new ByteArrayOutputStream();
/* 148 */     AnnotationsWriter writer = new AnnotationsWriter(output, this.constPool);
/*     */     try {
/* 150 */       int n = params.length;
/* 151 */       writer.numParameters(n);
/* 152 */       for (int i = 0; i < n; i++) {
/* 153 */         Annotation[] anno = params[i];
/* 154 */         writer.numAnnotations(anno.length);
/* 155 */         for (int j = 0; j < anno.length; j++) {
/* 156 */           anno[j].write(writer);
/*     */         }
/*     */       }
/* 159 */       writer.close();
/*     */     }
/*     */     catch (IOException e) {
/* 162 */       throw new RuntimeException(e);
/*     */     }
/*     */
View Full Code Here

/*     */   }
/*     */
/*     */   public void setDefaultValue(MemberValue value)
/*     */   {
/* 139 */     ByteArrayOutputStream output = new ByteArrayOutputStream();
/* 140 */     AnnotationsWriter writer = new AnnotationsWriter(output, this.constPool);
/*     */     try {
/* 142 */       value.write(writer);
/* 143 */       writer.close();
/*     */     }
/*     */     catch (IOException e) {
/* 146 */       throw new RuntimeException(e);
/*     */     }
/*     */
View Full Code Here

TOP

Related Classes of javassist.bytecode.annotation.AnnotationsWriter

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.