/** * Writes {@code num_annotations} in * {@code Runtime(In)VisibleTypeAnnotations_attribute}. * It must be followed by {@code num} instances of {@code type_annotation}. */ public void numAnnotations(int num) throws IOException { super.numAnnotations(num); }
/** * Writes {@code num_annotations} in * {@code Runtime(In)VisibleTypeAnnotations_attribute}. * It must be followed by {@code num} instances of {@code type_annotation}. */ @Override public void numAnnotations(int num) throws IOException { super.numAnnotations(num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
@Override int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); for (int i = 0; i < num; i++) { int targetType = info[pos] & 0xff; pos = sub.targetInfo(pos + 1, targetType); pos = sub.typePath(pos); pos = annotation(pos); } return pos; } }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param params the data structure representing the * new annotations. Every element of this array * is an array of <code>Annotation</code> and * it represens annotations of each method parameter. */ public void setAnnotations(Annotation[][] params) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = params.length; writer.numParameters(n); for (int i = 0; i < n; ++i) { Annotation[] anno = params[i]; writer.numAnnotations(anno.length); for (int j = 0; j < anno.length; ++j) anno[j].write(writer); } writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
@Override int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); for (int i = 0; i < num; i++) { int targetType = info[pos] & 0xff; pos = sub.targetInfo(pos + 1, targetType); pos = sub.typePath(pos); pos = annotation(pos); } return pos; } }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param params the data structure representing the * new annotations. Every element of this array * is an array of <code>Annotation</code> and * it represens annotations of each method parameter. */ public void setAnnotations(Annotation[][] params) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { writer.numParameters(params.length); for (Annotation[] anno:params) { writer.numAnnotations(anno.length); for (int j = 0; j < anno.length; ++j) anno[j].write(writer); } writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
int annotationArray(int pos, int num) throws Exception { writer.numAnnotations(num); return super.annotationArray(pos, num); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }
/** * Changes the annotations represented by this object according to * the given array of <code>Annotation</code> objects. * * @param annotations the data structure representing the * new annotations. */ public void setAnnotations(Annotation[] annotations) { ByteArrayOutputStream output = new ByteArrayOutputStream(); AnnotationsWriter writer = new AnnotationsWriter(output, constPool); try { int n = annotations.length; writer.numAnnotations(n); for (int i = 0; i < n; ++i) annotations[i].write(writer); writer.close(); } catch (IOException e) { throw new RuntimeException(e); // should never reach here. } set(output.toByteArray()); }