Package org.objectweb.asm.attrs

Examples of org.objectweb.asm.attrs.Annotation$EnumConstValue


    private void addAnnotations(final Attribute attrs) {
        Attribute attributes = attrs;
        while (attributes != null) {
            if (attributes instanceof RuntimeInvisibleAnnotations) {
                for (Iterator it = ((RuntimeInvisibleAnnotations)attributes).annotations.iterator(); it.hasNext();) {
                    Annotation annotation = (Annotation)it.next();
                    if (CustomAttribute.TYPE.equals(annotation.type)) {
                        m_annotations.add(CustomAttributeHelper.extractCustomAnnotation(annotation));
                    } else {
                        AnnotationInfo annotationInfo = AsmClassInfo.getAnnotationInfo(
                                annotation,
                                (ClassLoader)m_loaderRef.get()
                        );
                        m_annotations.add(annotationInfo);
                    }
                }
            }
            if (attributes instanceof RuntimeVisibleAnnotations) {
                for (Iterator it = ((RuntimeVisibleAnnotations)attributes).annotations.iterator(); it.hasNext();) {
                    Annotation annotation = (Annotation)it.next();
                    AnnotationInfo annotationInfo = AsmClassInfo.getAnnotationInfo(
                            annotation,
                            (ClassLoader)m_loaderRef.get()
                    );
                    m_annotations.add(annotationInfo);
View Full Code Here


     *
     * @param bytes
     * @return
     */
    public static Annotation createCustomAnnotation(final byte[] bytes) {
        Annotation annotation = new Annotation();
        annotation.type = CustomAttribute.TYPE;
        annotation.add(VALUE, Base64.encodeBytes(bytes));
        return annotation;
    }
View Full Code Here

     */
    public static List extractAnnotations(List annotations, final Attribute attribute, final ClassLoader loader) {
        for (Attribute current = attribute; current != null; current = current.next) {
            if (current instanceof RuntimeInvisibleAnnotations) {
                for (Iterator it = ((RuntimeInvisibleAnnotations) current).annotations.iterator(); it.hasNext();) {
                    Annotation annotation = (Annotation) it.next();
                    if (CustomAttribute.TYPE.equals(annotation.type)) {
                        annotations.add(CustomAttributeHelper.extractCustomAnnotation(annotation));
                    } else {
                        AnnotationInfo annotationInfo = AsmClassInfo.getAnnotationInfo(
                                annotation,
                                loader
                        );
                        annotations.add(annotationInfo);
                    }
                }
            } else if (current instanceof RuntimeVisibleAnnotations) {
                for (Iterator it = ((RuntimeVisibleAnnotations) current).annotations.iterator(); it.hasNext();) {
                    Annotation annotation = (Annotation) it.next();
                    AnnotationInfo annotationInfo = AsmClassInfo.getAnnotationInfo(
                            annotation,
                            loader
                    );
                    annotations.add(annotationInfo);
View Full Code Here

TOP

Related Classes of org.objectweb.asm.attrs.Annotation$EnumConstValue

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.