Package org.codehaus.aspectwerkz.expression

Examples of org.codehaus.aspectwerkz.expression.ExpressionVisitor


                .match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
        assertTrue(new ExpressionInfo(
            "execution(void test.expression.Target.modifiers1()) && !call(void test.expression.Target.modifiers1())",
            NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
        ExpressionVisitor expression = new ExpressionInfo(
            "execution(void test.expression.Target.modifiers1()) && !call(void test.expression.Target.modifiers3()) && !(call(void test.expression.Target.modifiers1()) || call(void test.expression.Target.modifiers2()))",
            NAMESPACE).getExpression();
        assertTrue(expression.match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
        assertFalse(expression.match(new ExpressionContext(PointcutType.CALL, modifiers1, s_declaringType)));
        assertFalse(expression.match(new ExpressionContext(PointcutType.SET, modifier1, s_declaringType)));
        assertFalse(new ExpressionInfo(
            "call(void test.expression.Target.modifiers1()) && !set(int test.expression.Target.modifier1)",
            NAMESPACE).getExpression().match(new ExpressionContext(PointcutType.CALL, modifier1, null)));
    }
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];
                ExpressionVisitor expression = expressionInfo.getExpression();
                if (expression.match(ctx)) {
                    interfaceIntroductionDefs.add(introDef);
                }
            }
        }
        return interfaceIntroductionDefs;
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];
                ExpressionVisitor expression = expressionInfo.getExpression();
                if (expression.match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        }
        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();
                ExpressionVisitor expression = adviceDef.getExpressionInfo().getExpression();

                if (expression.match(ctx)) {
                    if (AspectWerkzPreProcessor.DETAILS) {
                        System.out.println(
                                "match: " + expression.toString() + " @ " + aspectDef.getName() + "/" +
                                adviceDef.getName()
                        );
                        System.out.println("\tfor     " + ctx.getReflectionInfo());
                        System.out.println("\twithin  " + ctx.getWithinReflectionInfo());
                        System.out.println("\ttype    " + ctx.getPointcutType().toString());
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];
                ExpressionVisitor expression = expressionInfo.getExpression();
                if (expression.match(ctx)) {
                    interfaceIntroductionDefs.add(introDef);
                }
            }
        }
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];
                ExpressionVisitor expression = expressionInfo.getExpression();
                if (expression.match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        }
        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();
                ExpressionVisitor expression = adviceDef.getExpressionInfo().getExpression();
                if (expression.match(ctx)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

                        "execution(void test.expression.Target.modifiers1()) && !call(void test.expression.Target.modifiers1())",
                        NAMESPACE
                ).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType))
        );
        ExpressionVisitor expression = new ExpressionInfo(
                "execution(void test.expression.Target.modifiers1()) && !call(void test.expression.Target.modifiers3()) && !(call(void test.expression.Target.modifiers1()) || call(void test.expression.Target.modifiers2()))",
                NAMESPACE
        ).getExpression();
        assertTrue(expression.match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
        assertFalse(expression.match(new ExpressionContext(PointcutType.CALL, modifiers1, s_declaringType)));
        assertFalse(expression.match(new ExpressionContext(PointcutType.SET, modifier1, s_declaringType)));
        assertFalse(
                new ExpressionInfo(
                        "call(void test.expression.Target.modifiers1()) && !set(int test.expression.Target.modifier1)",
                        NAMESPACE
                ).getExpression().match(new ExpressionContext(PointcutType.CALL, modifier1, null))
View Full Code Here

    }

    public Object visit(ASTPointcutReference node, Object data) {
        ExpressionContext context = (ExpressionContext) data;
        ExpressionNamespace namespace = ExpressionNamespace.getNamespace(m_namespace);
        ExpressionVisitor expression = namespace.getExpression(node.getName());

        // build a new RuntimeCheckVisitor to visit the sub expression
        RuntimeCheckVisitor referenced = new RuntimeCheckVisitor(
                m_compiler, cv, expression.getExpressionInfo(),
                m_isOptimizedJoinPoint, m_joinPointIndex,
                m_calleeIndex
        );
        return referenced.matchUndeterministic(context);
    }
View Full Code Here

            for (Iterator it = aspectDef.getInterfaceIntroductionDefinitions().iterator(); it.hasNext();) {
                InterfaceIntroductionDefinition introDef = (InterfaceIntroductionDefinition) it.next();
                ExpressionInfo[] expressionInfos = introDef.getExpressionInfos();
                for (int i = 0; i < expressionInfos.length; i++) {
                    ExpressionInfo expressionInfo = expressionInfos[i];
                    ExpressionVisitor expression = expressionInfo.getExpression();
                    if (expression.match(ctx)) {
                        interfaceIntroductionDefs.add(introDef);
                    }
                }
            }
        }
View Full Code Here

TOP

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

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.