Examples of AnnotationVisitor


Examples of jodd.asm5.AnnotationVisitor

  /**
   * Copies all destination type annotations to the target.
   */
  @Override
  public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
    AnnotationVisitor destAnn = wd.dest.visitAnnotation(desc, visible); // [A3]
    return new AnnotationVisitorAdapter(destAnn);
  }

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;

Examples of nginx.clojure.asm.AnnotationVisitor

                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);
            }
        }
    }

Examples of org.apache.cxf.common.util.ASMHelper.AnnotationVisitor

        }
       
        ClassWriter cw = helper.createClassWriter();
        FieldVisitor fv;
        MethodVisitor mv;
        AnnotationVisitor av0;
       
        cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER + Opcodes.ACC_SYNTHETIC,
                 className + "Extensibility", null,
                 className,
                 new String[] {"javax/wsdl/extensions/ExtensibilityElement"});

        cw.visitSource(cls.getSimpleName() + "Extensibility.java", null);
       
        fv = cw.visitField(Opcodes.ACC_PRIVATE + Opcodes.ACC_FINAL + Opcodes.ACC_STATIC,
                           "WSDL_REQUIRED", "Ljavax/xml/namespace/QName;", null, null);
        fv.visitEnd();       
        fv = cw.visitField(0, "qn", "Ljavax/xml/namespace/QName;", null, null);
        fv.visitEnd();
       

        boolean hasAttributes = false;
        try {
            Method m = cls.getDeclaredMethod("getOtherAttributes");
            if (m != null && m.getReturnType() == Map.class){
                hasAttributes = true;
            }
        } catch (Throwable t) {
            //ignore
        }
        if (hasAttributes) {
            mv = cw.visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V", null, null);
            mv.visitCode();
            Label l0 = helper.createLabel();
            mv.visitLabel(l0);
            mv.visitLineNumber(64, l0);
            mv.visitTypeInsn(Opcodes.NEW, "javax/xml/namespace/QName");
            mv.visitInsn(Opcodes.DUP);
            mv.visitLdcInsn("http://schemas.xmlsoap.org/wsdl/");
            mv.visitLdcInsn("required");
            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName", "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
            mv.visitFieldInsn(Opcodes.PUTSTATIC, className + "Extensibility", "WSDL_REQUIRED", "Ljavax/xml/namespace/QName;");
            mv.visitInsn(Opcodes.RETURN);
            mv.visitMaxs(4, 0);
            mv.visitEnd();
        } else {
            fv = cw.visitField(Opcodes.ACC_PRIVATE, "required", "Ljava/lang/Boolean;", null, null);
            fv.visitEnd();
        }
       
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        Label l0 = helper.createLabel();
        mv.visitLabel(l0);
        mv.visitLineNumber(33, l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, className, "<init>", "()V", false);
        Label l1 = helper.createLabel();
        mv.visitLabel(l1);
        mv.visitLineNumber(31, l1);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitTypeInsn(Opcodes.NEW, "javax/xml/namespace/QName");
        mv.visitInsn(Opcodes.DUP);
       
        mv.visitLdcInsn(qname.getNamespaceURI());
        mv.visitLdcInsn(qname.getLocalPart());
       
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName",
                           "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
        mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility",
                          "qn", "Ljavax/xml/namespace/QName;");
        Label l2 = helper.createLabel();
        mv.visitLabel(l2);
        mv.visitLineNumber(34, l2);
        mv.visitInsn(Opcodes.RETURN);
        Label l3 = helper.createLabel();
        mv.visitLabel(l3);
      
        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l3, 0);
        mv.visitMaxs(5, 1);
        mv.visitEnd();

        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setElementType", "(Ljavax/xml/namespace/QName;)V", null, null);
        mv.visitCode();
        l0 = helper.createLabel();
        mv.visitLabel(l0);
        mv.visitLineNumber(37, l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility", "qn", "Ljavax/xml/namespace/QName;");
        l1 = helper.createLabel();
        mv.visitLabel(l1);
        mv.visitLineNumber(38, l1);
        mv.visitInsn(Opcodes.RETURN);
        l2 = helper.createLabel();
        mv.visitLabel(l2);
        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l2, 0);
        mv.visitLocalVariable("elementType", "Ljavax/xml/namespace/QName;", null, l0, l2, 1);
        mv.visitMaxs(2, 2);
        mv.visitEnd();

        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getElementType", "()Ljavax/xml/namespace/QName;", null, null);
        av0 = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        av0.visitEnd();
        mv.visitCode();
        l0 = helper.createLabel();
        mv.visitLabel(l0);
        mv.visitLineNumber(40, l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);

Examples of org.apache.tapestry5.internal.plastic.asm.AnnotationVisitor

    public AnnotationVisitor visitAnnotation(
        final String name,
        final String desc)
    {
        Printer p = this.p.visitAnnotation(name, desc);
        AnnotationVisitor av = this.av == null
                ? null
                : this.av.visitAnnotation(name, desc);
        return new TraceAnnotationVisitor(av, p);
    }

Examples of org.apache.xbean.asm4.AnnotationVisitor

            }
            final FieldInfo fieldInfo = testFieldInfo;
            return new FieldVisitor(Opcodes.ASM4, toWrap) {
                @Override
                public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
                    final AnnotationVisitor toWrap = super.visitAnnotation(desc, visible);
                    return visible ? toWrap : new TopLevelAnnotationInflater(desc, toWrap, fieldInfo);
                }
            };
        }

Examples of org.codehaus.enunciate.asm.AnnotationVisitor

                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);
            }
        }
    }

Examples of org.deuce.objectweb.asm.AnnotationVisitor

    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;
    }

Examples of org.drools.asm.AnnotationVisitor

     */
    protected FieldVisitor fv;

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

Examples of org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor

        mv.visitMaxs(1, 1);
        mv.visitEnd();

        // Write: public List getAdaptedValue()
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getAdaptedValue", "()Ljava/util/List;", "()Ljava/util/List<" + Type.getType(L + getObjectType(nestedClass).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON) + ">;", null);
        AnnotationVisitor av;
        // Copy annotations
        boolean hasXmlList = false;
        Annotation[] annotations;
        if (typeMappingInfo != null && ((annotations = getAnnotations(typeMappingInfo)) != null)) {
            for (Annotation annotation : annotations) {
                Class<? extends Annotation> annotationType = annotation.annotationType();
                if(annotationType.equals(XmlList.class)) {
                    hasXmlList = true;
                }
                av = mv.visitAnnotation(L + annotationType.getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON, true);
                for (Method next : annotation.annotationType().getDeclaredMethods()) {
                    try {
                        Object nextValue = next.invoke(annotation, new Object[] {});
                        if (nextValue instanceof Class) {
                            nextValue = Type.getType(L + ((Class) nextValue).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON);
                        }
                        av.visit(next.getName(), nextValue);
                    } catch (InvocationTargetException ex) {
                    } catch (IllegalAccessException ex) {
                    }
                }
                av.visitEnd();
            }
        }
        if(hasXmlList) {
            // @XmlValue
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlValue;", true);
            av.visitEnd();
        } else {
            // @XmlElement(name, type)
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
            av.visit("name", ITEM);
            av.visit("nillable", true);
            av.visitEnd();
        }

        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitFieldInsn(Opcodes.GETFIELD, qualifiedInternalClassName, "adaptedValue", "Ljava/util/List;");
        mv.visitInsn(Opcodes.ARETURN);
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.