Package net.sf.joafip.asm

Examples of net.sf.joafip.asm.AnnotationVisitor


  // Implementation of the MethodVisitor interface
  // ------------------------------------------------------------------------

  public AnnotationVisitor visitAnnotation(final String desc,
      final boolean visible) {
    AnnotationVisitor av = super.visitAnnotation(desc, visible);
    if (mv != null) {
      ((TraceAnnotationVisitor) av).av = mv
          .visitAnnotation(desc, visible);
    }
    return av;


  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(
        V1_5,
        ACC_PUBLIC + ACC_SUPER,

   */
  public void accept(final MethodVisitor mv) {
    // visits the method attributes
    int i, j, n;
    if (annotationDefault != null) {
      AnnotationVisitor av = mv.visitAnnotationDefault();
      AnnotationNode.accept(av, null, annotationDefault);
      if (av != null) {
        av.visitEnd();
      }
    }
    n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
    for (i = 0; i < n; ++i) {
      AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);

  @SuppressWarnings("unchecked")
  public AnnotationVisitor visitAnnotation(final String desc,
      final boolean visible) {
    text.add("\n");
    AnnotationVisitor tav = super.visitAnnotation(desc, visible);
    if (cv != null) {
      ((TraceAnnotationVisitor) tav).av = cv.visitAnnotation(desc,
          visible);
    }
    return tav;

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "net/sf/joafip/asm/New", null,
        "java/lang/Object", null);

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/asm/NewProxyCallBack", null, "java/lang/Object",
        null);

   */
  protected FieldVisitor fv;

  public AnnotationVisitor visitAnnotation(final String desc,
      final boolean visible) {
    AnnotationVisitor av = super.visitAnnotation(desc, visible);
    if (fv != null) {
      ((TraceAnnotationVisitor) av).av = fv
          .visitAnnotation(desc, visible);
    }
    return av;

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    AnnotationVisitor av0;

    cw.visit(
        V1_6,
        ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/store/service/proxy/JoafipObject",
        null,
        "java/lang/Object",
        new String[] { "net/sf/joafip/store/service/proxy/IProxyCallBack" });

    {
      av0 = cw.visitAnnotation("Lnet/sf/joafip/NotStorableClass;", true);
      av0.visitEnd();
    }
    {
      fv = cw.visitField(
          ACC_PRIVATE + ACC_TRANSIENT,
          "proxyCallBack",

        av.visitEnum(name, typeconst[0], typeconst[1]);
      } else if (value instanceof AnnotationNode) {
        AnnotationNode an = (AnnotationNode) value;
        an.accept(av.visitAnnotation(name, an.desc));
      } else if (value instanceof List) {
        AnnotationVisitor v = av.visitArray(name);
        List array = (List) value;
        for (int j = 0; j < array.size(); ++j) {
          accept(v, null, array.get(j));
        }
        v.visitEnd();
      } else {
        av.visit(name, value);
      }
    }
  }

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/asm/StaticProxyCallBackCall", null,
        "java/lang/Object", null);

TOP

Related Classes of net.sf.joafip.asm.AnnotationVisitor

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.