javassist.bytecode.annotation.Annotation.write()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中javassist.bytecode.annotation.Annotation.write()方法的一些代码示例,展示了Annotation.write()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.write()方法的具体详情如下:
包路径:javassist.bytecode.annotation.Annotation
类名称:Annotation
方法名:write

Annotation.write介绍

[英]Writes this annotation.
[中]编写此注释。

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: org.javassist/javassist

/**
 * Writes the value.
 */
@Override
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: redisson/redisson

/**
 * 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());
}

代码示例来源:origin: redisson/redisson

/**
 * 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());
}

代码示例来源:origin: org.javassist/javassist

/**
 * 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());
}

代码示例来源:origin: org.javassist/javassist

/**
 * 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());
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: org.jboss/javassist

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: org.jboss.javassist/com.springsource.javassist

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Writes the value.
 */
public void write(AnnotationsWriter writer) throws IOException {
  writer.annotationValue();
  value.write(writer);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * 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());
}

代码示例来源:origin: org.jboss/javassist

/**
 * 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());
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * 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());
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * 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());
}

代码示例来源:origin: org.jboss.javassist/com.springsource.javassist

/**
 * 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());
}

代码示例来源:origin: org.jboss.javassist/com.springsource.javassist

/**
 * 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());
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * 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());
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * 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());
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * 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());
}

相关文章