Package org.codehaus.aspectwerkz.annotation

Examples of org.codehaus.aspectwerkz.annotation.AnnotationInfo




    public void testToString() throws Throwable {

        AnnotationInfo annI = (AnnotationInfo) getAnnotatedMethod().getAnnotations().get(0);

        DefaultedAnnotation ann = (DefaultedAnnotation) annI.getAnnotation();



        System.out.println("");
View Full Code Here


    public Object visit(ASTAttribute node, Object data) {
        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

    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

    public void testAnnotationLoadingWithClassRef() throws Throwable {
        System.out.println("START");
        ClassInfo klass = AsmClassInfo.getClassInfo("test.annotation.AnnotationLoadingTarget", AnnotationLoadingTest.class.getClassLoader());
        MethodInfo m = klass.getMethods()[0];
        AnnotationInfo annInfo = (AnnotationInfo) m.getAnnotations().get(0);

        System.out.println("DONE");
        System.out.println(annInfo.getAnnotation());
        AnnotationParserTest.Complex c = ((AnnotationParserTest.Complex)annInfo.getAnnotation());
        System.out.println(c.klass().getName());
        System.out.println(c.toString());
        System.out.println(c.klass2()[0]);
    }
View Full Code Here

            throw new Error("test corrupted");
        }
    }

    public void testDefaultedAnnotation() {
        AnnotationInfo annI = (AnnotationInfo) getAnnotatedMethod().getAnnotations().get(0);
        DefaultedAnnotation ann = (DefaultedAnnotation) annI.getAnnotation();

        // string
        assertEquals("default", ann.s());

        // primitive array
View Full Code Here

        assertEquals(ReferencedClass[].class.getName(), ann.klass2()[0].getName());
        assertEquals(ReferencedClass.class, ann.klass2()[1]);
    }

    public void testToString() throws Throwable {
        AnnotationInfo annI = (AnnotationInfo) getAnnotatedMethod().getAnnotations().get(0);
        DefaultedAnnotation ann = (DefaultedAnnotation) annI.getAnnotation();

        System.out.println("");
        System.out.println(ann.toString());
        System.out.println(ann.annotationType());
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) {
        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

     * @return the annotation or null
     */
    public static Annotation getAnnotation(final String annotationName, final ClassInfo classInfo) {
        List annotations = classInfo.getAnnotations();
        for (Iterator it = annotations.iterator(); it.hasNext();) {
            AnnotationInfo annotationInfo = (AnnotationInfo)it.next();
            if (annotationInfo.getName().equals(annotationName)) {
                return annotationInfo.getAnnotation();
            }
        }
        return null;
    }
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.