Package org.codehaus.aspectwerkz.expression

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo


        }
        for (Iterator it = m_aspectMap.values().iterator(); it.hasNext();) {
            AspectDefinition aspectDef = (AspectDefinition) it.next();
            for (Iterator it2 = aspectDef.getAllAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition) it2.next();
                ExpressionInfo expressionInfo = adviceDef.getExpressionInfo();
                if (expressionInfo.hasCflowPointcut() && expressionInfo.getCflowExpression().match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here


        }
        for (Iterator it = m_introductionMap.values().iterator(); it.hasNext();) {
            IntroductionDefinition introDef = (IntroductionDefinition) it.next();
            ExpressionInfo[] expressionInfos = introDef.getExpressionInfos();
            for (int i = 0; i < expressionInfos.length; i++) {
                ExpressionInfo expressionInfo = expressionInfos[i];
                for (int j = 0; j < ctxs.length; j++) {
                    if (expressionInfo.getAdvisedClassFilterExpression().match(ctxs[j])) {
                        return true;
                    }
                }
            }
        }
View Full Code Here

        }
        for (Iterator it = m_introductionMap.values().iterator(); it.hasNext();) {
            IntroductionDefinition introDef = (IntroductionDefinition) it.next();
            ExpressionInfo[] expressionInfos = introDef.getExpressionInfos();
            for (int i = 0; i < expressionInfos.length; i++) {
                ExpressionInfo expressionInfo = expressionInfos[i];
                if (expressionInfo.getAdvisedClassFilterExpression().match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        }
        for (Iterator it = m_interfaceIntroductionMap.values().iterator(); it.hasNext();) {
            InterfaceIntroductionDefinition introDef = (InterfaceIntroductionDefinition) it.next();
            ExpressionInfo[] expressionInfos = introDef.getExpressionInfos();
            for (int i = 0; i < expressionInfos.length; i++) {
                ExpressionInfo expressionInfo = expressionInfos[i];
                if (expressionInfo.getAdvisedClassFilterExpression().match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        super(name);
    }

    // ============ constructor signature test =============
    public void testConstructor() throws Exception {
        assertTrue(new ExpressionInfo("call(test.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
        assertFalse(new ExpressionInfo("call(test.expression.Target.new(String))", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
        //AW-112 below
        assertTrue(new ExpressionInfo("within(test.expression.Target) && execution(new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
        assertTrue(new ExpressionInfo("within(test..*) && execution(*.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, constructor.getDeclaringType())));
        assertTrue(new ExpressionInfo("within(test..*.*) && execution(*.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, constructor.getDeclaringType())));
    }
View Full Code Here

            new ExpressionContext(PointcutType.EXECUTION, constructor, constructor.getDeclaringType())));
    }

    // ============ constructor modifiers test =============
    public void testConstructorModifiers1() throws Exception {
        assertTrue(new ExpressionInfo("call(public test.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
        assertFalse(new ExpressionInfo("call(private test.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
    }
View Full Code Here

            new ExpressionContext(PointcutType.CALL, constructor, null)));
    }

    //  ============ constructor annotations test =============
    public void testConstructorAnnotations1() throws Exception {
        assertTrue(new ExpressionInfo("call(@Requires test.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
        assertFalse(new ExpressionInfo("call(@RequiresNew test.expression.Target.new())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, constructor, null)));
        assertTrue(new ExpressionInfo("execution(@Requires test.expression.Target.new())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
        assertFalse(new ExpressionInfo("execution(@RequiresNew test.expression.Target.new())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
    }
View Full Code Here

        assertFalse(new ExpressionInfo("execution(@RequiresNew test.expression.Target.new())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
    }

    public void testConstructorAnnotations2() throws Exception {
        assertTrue(new ExpressionInfo("execution(@Requires *..*.new(..))", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
        assertFalse(new ExpressionInfo("execution(RequiresNew *..*.new(..))", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.EXECUTION, constructor, null)));
        assertTrue(new ExpressionInfo("call(@Requires *..*.new(..))", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
        assertFalse(new ExpressionInfo("call(RequiresNew *..*.new(..))", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, constructor, null)));
    }
View Full Code Here

            new ExpressionContext(PointcutType.CALL, constructor, null)));
    }

    // ============ method modifiers test =============
    public void testMethodModifiers1() throws Exception {
        assertFalse(new ExpressionInfo("call(public void test.expression.Target.modifiers1())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers1, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.Target.modifiers1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, modifiers1, null)));
        assertFalse(new ExpressionInfo("call(static final void test.expression.Target.modifiers1())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers1, null)));
    }
View Full Code Here

        assertFalse(new ExpressionInfo("call(static final void test.expression.Target.modifiers1())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers1, null)));
    }

    public void testMethodModifiers2() throws Exception {
        assertTrue(new ExpressionInfo("call(public void test.expression.Target.modifiers2())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers2, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.Target.modifiers2())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, modifiers2, null)));
        assertFalse(new ExpressionInfo("call(static final void test.expression.Target.modifiers2())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers2, null)));
        assertFalse(new ExpressionInfo("call(public static final void test.expression.Target.modifiers2())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers2, null)));
        assertTrue(new ExpressionInfo("call(public static void test.expression.Target.modifiers2())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, modifiers2, null)));
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.expression.ExpressionInfo

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.