Package org.objectweb.asm

Examples of org.objectweb.asm.AnnotationVisitor.visit()


        av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlAccessorType;", true);
        av0.visitEnum("value", "Ljavax/xml/bind/annotation/XmlAccessType;", "FIELD");
        av0.visitEnd();

        av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        av0.visit("name", wrapperElement.getLocalPart());
        av0.visit("namespace", wrapperElement.getNamespaceURI());
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
View Full Code Here


        av0.visitEnum("value", "Ljavax/xml/bind/annotation/XmlAccessType;", "FIELD");
        av0.visitEnd();

        av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        av0.visit("name", wrapperElement.getLocalPart());
        av0.visit("namespace", wrapperElement.getNamespaceURI());
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
View Full Code Here

        SchemaInfo si = interfaceInfo.getService().getSchema(ns);
        if (si != null) {
            q = si.isElementFormQualified();
        }
        AnnotationVisitor av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlSchema;", true);
        av0.visit("namespace", ns);
        av0.visitEnum("elementFormDefault",
                      getClassCode(XmlNsForm.class),
                      q ? "QUALIFIED" : "UNQUALIFIED");
        av0.visitEnd();
        cw.visitEnd();
View Full Code Here

        ClassDescriptor nullnessAnnotationType = getNullnessAnnotationClassDescriptor(n);

        // Construct an AnnotationValue containing the default annotation
        AnnotationValue annotationValue = new AnnotationValue(defaultAnnotationType);
        AnnotationVisitor v = annotationValue.getAnnotationVisitor();
        v.visit("value", Type.getObjectType(nullnessAnnotationType.getClassName()));
        v.visitEnd();

        if (DEBUG) {
            System.out.println("Adding AnnotationValue " + annotationValue + " to class " + xclass);
        }
View Full Code Here

        when(visitor.visitAnnotation("name", "type-desc")).thenReturn(visitor);

        AnnotationRecorder recorder = new AnnotationRecorder();
        AnnotationVisitor sub = recorder.visitAnnotation("name", "type-desc");
        sub.visit("name2", "value2");
        recorder.accept(visitor);

        verify(visitor).visitAnnotation("name", "type-desc");
        verify(visitor).visit("name2", "value2");
    }
View Full Code Here

        when(visitor.visitArray("name")).thenReturn(visitor);

        AnnotationRecorder recorder = new AnnotationRecorder();
        AnnotationVisitor sub = recorder.visitArray("name");
        sub.visit("name2", "value2");
        recorder.accept(visitor);

        verify(visitor).visitArray("name");
        verify(visitor).visit("name2", "value2");
    }
View Full Code Here

  private void add_module_annotation(ClassVisitor cv) {

    AnnotationVisitor av = cv.visitAnnotation(
        MODULE_ANN_TYPE.getDescriptor(), true);
    av.visit("value", getModuleName());

    av.visitEnd();
  }

  public String getInternalClassName() {
View Full Code Here

      FieldVisitor fv = cv.visitField(ACC_STATIC, ent.getKey(), "L"
          + EFUN_NAME + f.arity + ";", null, null);
      EFunCG.ensure(f.arity);
      AnnotationVisitor av = fv.visitAnnotation(
          IMPORT_ANN_TYPE.getDescriptor(), true);
      av.visit("module", f.mod.getName());
      av.visit("fun", f.fun.getName());
      av.visit("arity", f.arity);
      av.visitEnd();
      fv.visitEnd();
    }
View Full Code Here

          + EFUN_NAME + f.arity + ";", null, null);
      EFunCG.ensure(f.arity);
      AnnotationVisitor av = fv.visitAnnotation(
          IMPORT_ANN_TYPE.getDescriptor(), true);
      av.visit("module", f.mod.getName());
      av.visit("fun", f.fun.getName());
      av.visit("arity", f.arity);
      av.visitEnd();
      fv.visitEnd();
    }
   
View Full Code Here

      EFunCG.ensure(f.arity);
      AnnotationVisitor av = fv.visitAnnotation(
          IMPORT_ANN_TYPE.getDescriptor(), true);
      av.visit("module", f.mod.getName());
      av.visit("fun", f.fun.getName());
      av.visit("arity", f.arity);
      av.visitEnd();
      fv.visitEnd();
    }
   
    generate_on_load();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.