Package org.codehaus.aspectwerkz.annotation

Examples of org.codehaus.aspectwerkz.annotation.AnnotationInfo


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


        List annotations = (List) data;

        for (Iterator it = annotations.iterator(); it.hasNext();) {

            AnnotationInfo annotation = (AnnotationInfo) it.next();

            if (annotation.getName().equals(node.getName())) {

                return Boolean.TRUE;

            }
View Full Code Here

    }

    public Object visit(ASTAttribute node, Object data) {
        List annotations = (List) data;
        for (Iterator it = annotations.iterator(); it.hasNext();) {
            AnnotationInfo annotation = (AnnotationInfo) it.next();
            if (annotation.getName().equals(node.getName())) {
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }
View Full Code Here

    public Object visit(ASTAttribute node, Object data) {
        // called for class level annotation matching f.e. in a within context
        List annotations = (List) data;
        for (Iterator it = annotations.iterator(); it.hasNext();) {
            AnnotationInfo annotation = (AnnotationInfo) it.next();
            if (annotation.getName().equals(node.getName())) {
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }
View Full Code Here

    public Object visit(ASTAttribute node, Object data) {
        // called for class level annotation matching f.e. in a within context
        boolean matchAnnotation = false;
        List annotations = (List) data;
        for (Iterator it = annotations.iterator(); it.hasNext();) {
            AnnotationInfo annotation = (AnnotationInfo) it.next();
            if (annotation.getName().equals(node.getName())) {
                matchAnnotation = true;
            }
        }
        if (node.isNot()) {
            return Util.booleanValueOf(!matchAnnotation);
View Full Code Here

            } catch (Exception e) {
                throw new WrappedRuntimeException(e);
            }
        }
        proxy.initialize(annotationName, annotationValues);
        return new AnnotationInfo(annotationName, proxy);
    }
View Full Code Here

     * @return the annotations in a list (can be empty)
     */
    public static List getAnnotations(final String annotationName, final ConstructorInfo constructorInfo) {
        List annotations = new ArrayList();
        for (Iterator it = constructorInfo.getAnnotations().iterator(); it.hasNext();) {
            AnnotationInfo annotationInfo = (AnnotationInfo) it.next();
            if (annotationInfo.getName().equals(annotationName)) {
                annotations.add(annotationInfo.getAnnotation());
            }
        }
        return annotations;
    }
View Full Code Here

     * @return the annotations in a list (can be empty)
     */
    public static List getAnnotations(final String annotationName, final FieldInfo fieldInfo) {
        List annotations = new ArrayList();
        for (Iterator it = fieldInfo.getAnnotations().iterator(); it.hasNext();) {
            AnnotationInfo annotationInfo = (AnnotationInfo) it.next();
            if (annotationInfo.getName().equals(annotationName)) {
                annotations.add(annotationInfo.getAnnotation());
            }
        }
        return annotations;
    }
View Full Code Here

                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 = 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 = getAnnotationInfo(annotation, loader);
                    annotations.add(annotationInfo);
                }
            } else if (current instanceof AnnotationDefaultAttribute) {
                AnnotationDefaultAttribute defaultAttribute = (AnnotationDefaultAttribute) current;
                AnnotationInfo annotationInfo = new AnnotationInfo(
                        AnnotationDefault.NAME,
                        new AnnotationDefault.AnnotationDefaultImpl(defaultAttribute.defaultValue)
                );
                annotations.add(annotationInfo);
            }
View Full Code Here

     * @param loader     the class loader that has loaded the proxy class to use
     * @return the annotation info
     */
    public static AnnotationInfo getAnnotationInfo(final Annotation annotation, final ClassLoader loader) {
        String annotationName = Type.getType(annotation.type).getClassName();
        return new AnnotationInfo(annotationName,
                                  Java5AnnotationInvocationHandler.getAnnotationProxy(annotation, loader)
        );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.annotation.AnnotationInfo

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.