Package com.alibaba.citrus.asm

Examples of com.alibaba.citrus.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);
            }
        }
    }


                push(((MethodVisitor) v).visitAnnotation(desc, visible));
            }
        }

        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

            push(((MethodVisitor) peek()).visitParameterAnnotation(parameter, desc, visible));
        }

        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

    }

    private final class AnnotationValueRule extends Rule {

        public void begin(final String nm, final Attributes attrs) throws SAXException {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            if (av != null) {
                av.visit(attrs.getValue("name"), getValue(attrs.getValue("desc"), attrs.getValue("value")));
            }
        }

    }

    private final class AnnotationValueEnumRule extends Rule {

        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            if (av != null) {
                av.visitEnum(attrs.getValue("name"), attrs.getValue("desc"), attrs.getValue("value"));
            }
        }

    }

    private final class AnnotationValueAnnotationRule extends Rule {

        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            push(av == null ? null : av.visitAnnotation(attrs.getValue("name"), attrs.getValue("desc")));
        }

            AnnotationVisitor av = (AnnotationVisitor) peek();
            push(av == null ? null : av.visitAnnotation(attrs.getValue("name"), attrs.getValue("desc")));
        }

        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

    }

    private final class AnnotationValueArrayRule extends Rule {

        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            push(av == null ? null : av.visitArray(attrs.getValue("name")));
        }

            AnnotationVisitor av = (AnnotationVisitor) peek();
            push(av == null ? null : av.visitArray(attrs.getValue("name")));
        }

        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

        this.fv = fv;
        this.remapper = remapper;
    }

    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
        AnnotationVisitor av = fv.visitAnnotation(desc, visible);
        return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
    }

TOP

Related Classes of com.alibaba.citrus.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.