Examples of visitAnnotation()


Examples of org.objectweb.asm.ClassWriter.visitAnnotation()

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

        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());
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

  }

  public void declareField(BytecodeContextTypeASM context, String name, IBytecodeField field) {
    FieldVisitor fv = context.getClassWriter().visitField(getAccess(field.getAccess()), name, field.getType().toDescriptorString(), null, null);
    for (IBytecodeAnnotation ba : field.getDeclaredAnnotations()) {
      this.declareAnnotation(context, ba, fv.visitAnnotation(ba.getType().getType().toDescriptorString(), true));
    }
    fv.visitEnd();
  }

  public void end(BytecodeContextTypeASM context) {
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

            an.visit("module", module_name.getName());
            an.visit("fun", fun_name.getName());
            an.visit("arity", new Integer(arity));
            an.visitEnd();
          } else if (uses_on_load) {
            AnnotationVisitor an = fv.visitAnnotation(
                INTERNAL_ANN_TYPE.getDescriptor(), true);
            an.visit("module", module_name.getName());
            an.visit("fun", fun_name.getName());
            an.visit("arity", new Integer(arity));
            an.visitEnd();
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

    return new FieldVisitor() {
      public AnnotationVisitor visitAnnotation( String desc, boolean visible ) {
        if ( visible ) {
          annotationPresent = true;
        }
        return v.visitAnnotation( desc, visible );
      }
      public void visitAttribute( Attribute attr ) {
        v.visitAttribute( attr );
      }
      public void  visitEnd() {
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

                                        classCode,
                                        fieldDescriptor,
                                        null);
       
       
        AnnotationVisitor av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
        av0.visit("name", name);
        if (factory.isWrapperPartQualified(mpi)) {
            av0.visit("namespace", mpi.getConcreteName().getNamespaceURI());           
        }
        if (factory.isWrapperPartNillable(mpi)) {
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

   */
  private final void generateField(String fieldName, String fieldDescriptor) {
    FieldVisitor fv = cv.visitField(ACC_PROTECTED | ACC_TRANSIENT | ACC_SYNTHETIC
        | ACC_FINAL, fieldName, fieldDescriptor, null, null);
    for (String s : annotationTypeDescriptors)
      fv.visitAnnotation(s, true).visitEnd();
    fv.visitEnd();
  }

  /**
   * Get a generator for a method, this be annotated with the "invisibility"
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

        AnnotationVisitor av0;
        fv = cw.visitField(ACC_PROTECTED, getFieldName(propName), propClassSignature, propTypeSignature, null);

        // For Map property, we cannot have the XmlElement annotation
        if (isElement && xmlAdapterClassSignature == null) {
            av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
            av0.visit("name", propName);
            av0.visit("namespace", "");
            if (isNillable) {
                av0.visit("nillable", Boolean.TRUE);
            }
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

            // av0.visit("required", Boolean.FALSE);
            av0.visitEnd();
        }

        if (xmlAdapterClassSignature != null) {
            av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlAnyElement;", true);
            av0.visit("lax", Boolean.TRUE);
            av0.visitEnd();
            av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/adapters/XmlJavaTypeAdapter;", true);
            av0.visit("value", org.objectweb.asm.Type.getType(xmlAdapterClassSignature));
            av0.visitEnd();
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

        if (xmlAdapterClassSignature != null) {
            av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlAnyElement;", true);
            av0.visit("lax", Boolean.TRUE);
            av0.visitEnd();
            av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/adapters/XmlJavaTypeAdapter;", true);
            av0.visit("value", org.objectweb.asm.Type.getType(xmlAdapterClassSignature));
            av0.visitEnd();
        }

        for (Annotation ann : jaxbAnnotations) {
View Full Code Here

Examples of org.objectweb.asm.FieldVisitor.visitAnnotation()

            av0.visitEnd();
        }

        for (Annotation ann : jaxbAnnotations) {
            if (ann instanceof XmlMimeType) {
                AnnotationVisitor mime = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlMimeType;", true);
                mime.visit("value", ((XmlMimeType)ann).value());
                mime.visitEnd();
            } else if (ann instanceof XmlJavaTypeAdapter) {
                AnnotationVisitor ada = fv.visitAnnotation("Ljavax/xml/bind/annotation/adapters/XmlJavaTypeAdapter;", true);
                ada.visit("value", org.objectweb.asm.Type.getType(((XmlJavaTypeAdapter)ann).value()));
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.