Package org.codehaus.aspectwerkz.definition.expression

Examples of org.codehaus.aspectwerkz.definition.expression.PointcutType


            Element pointcutDefElement = aspectElement.addElement("pointcut-def");
            pointcutDefElement.addAttribute("name", pointcutDef.getName());
            pointcutDefElement.addAttribute("non-reentrant", pointcutDef.getNonReentrant());

            PointcutType pointcutType = pointcutDef.getType();
            if (pointcutType.equals(PointcutType.EXECUTION)) {
                pointcutDefElement.addAttribute("type", "method");
            }
            else if (pointcutType.equals(PointcutType.CALL)) {
                pointcutDefElement.addAttribute("type", "callerSide");
            }
            else if (pointcutType.equals(PointcutType.GET)) {
                pointcutDefElement.addAttribute("type", "getField");
            }
            else if (pointcutType.equals(PointcutType.SET)) {
                pointcutDefElement.addAttribute("type", "setField");
            }
            else if (pointcutType.equals(PointcutType.CFLOW)) {
                pointcutDefElement.addAttribute("type", "cflow");
            }
            else if (pointcutType.equals(PointcutType.THROWS)) {
                pointcutDefElement.addAttribute("type", "throws");
            }
            else if (pointcutType.equals(PointcutType.CLASS)) {
                pointcutDefElement.addAttribute("type", "class");
            }
            else {
                throw new ExpressionException("pointcut type not supported: " + pointcutType);
            }
View Full Code Here


        for (Iterator it2 = aspect.elementIterator(); it2.hasNext();) {
            final Element nestedAdviceElement = (Element)it2.next();
            if (nestedAdviceElement.getName().trim().equals("pointcut-def")) {
                String pointcutName = null;
                String expression = null;
                PointcutType pointcutType = null;
                try {
                    for (Iterator it3 = nestedAdviceElement.attributeIterator(); it3.hasNext();) {
                        Attribute attribute = (Attribute)it3.next();
                        final String name = attribute.getName().trim();
                        final String value = attribute.getValue().trim();
View Full Code Here

                        final String value = attribute.getValue().trim();
                        if (name.equals("name")) {
                            pointcutDef.setName(value);
                        }
                        else if (name.equals("type")) {
                            PointcutType type = null;
                            if (value.equalsIgnoreCase(METHOD)) {
                                type = PointcutType.EXECUTION;
                                String expression = nestedAdviceElement.attributeValue("pattern");
                                pointcutDef.setExpression(PatternFactory.createMethodPattern(
                                        expression, packageName
View Full Code Here

    }

    public Object visit(InNode node, Object data) {
        // assert RHS is of CFLOW type
        // note: anonymous type like "IN true" is assumed valid
        PointcutType rhs = getRightHS(node, this, data);
        if (rhs!=null && ! rhs.equals(PointcutType.CFLOW))
            throw new RuntimeException("IN type not valid");
        return getLeftHS(node, this, data);
    }
View Full Code Here

            Element pointcutDefElement = aspectElement.addElement("pointcut-def");
            pointcutDefElement.addAttribute("name", pointcutDef.getName());
            // TODO remove all non-reentrant things
            //pointcutDefElement.addAttribute("non-reentrant", pointcutDef.getNonReentrant());

            PointcutType pointcutType = pointcutDef.getType();
            if (pointcutType.equals(PointcutType.EXECUTION)) {
                pointcutDefElement.addAttribute("type", "method");
            }
            else if (pointcutType.equals(PointcutType.CALL)) {
                pointcutDefElement.addAttribute("type", "callerSide");
            }
            else if (pointcutType.equals(PointcutType.GET)) {
                pointcutDefElement.addAttribute("type", "getField");
            }
            else if (pointcutType.equals(PointcutType.SET)) {
                pointcutDefElement.addAttribute("type", "setField");
            }
            else if (pointcutType.equals(PointcutType.CFLOW)) {
                pointcutDefElement.addAttribute("type", "cflow");
            }
            else if (pointcutType.equals(PointcutType.THROWS)) {
                pointcutDefElement.addAttribute("type", "throws");
            }
            else if (pointcutType.equals(PointcutType.CLASS)) {
                pointcutDefElement.addAttribute("type", "class");
            }
            else {
                throw new ExpressionException("pointcut type not supported: " + pointcutType);
            }
View Full Code Here

    }

    public Object visit(NotInNode node, Object data) {
        // assert RHS is of CFLOW type
        // note: anonymous type like "IN true" is assumed valid
        PointcutType rhs = getRightHS(node, this, data);
        if (rhs!=null && ! rhs.equals(PointcutType.CFLOW))
        if (rhs!=null && ! rhs.equals(PointcutType.CFLOW))
            throw new RuntimeException("NOT IN type not valid");
        return getLeftHS(node, this, data);
    }
View Full Code Here

    private PointcutType getRightHS(SimpleNode node, ExpressionParserVisitor visitor, Object data) {
        return (PointcutType)node.jjtGetChild(1).jjtAccept(this, data);
    }

    private PointcutType getResultingType(SimpleNode node, ExpressionParserVisitor visitor, Object data) {
        PointcutType lhs = getLeftHS(node, this, data);
        PointcutType rhs = getRightHS(node, this, data);

        if (node.jjtGetChild(0) instanceof BooleanLiteral) {
            // ignore lhs literal
            return rhs;
        } else if (node.jjtGetChild(1) instanceof BooleanLiteral) {
            // ignore rhs literal
            return lhs;
        } else {
            if (rhs!=null && rhs.equals(lhs)) {
                return rhs;
            } else {
                return null;
            }
        }
View Full Code Here

        for (Iterator it2 = aspect.elementIterator(); it2.hasNext();) {
            final Element nestedAdviceElement = (Element)it2.next();
            if (nestedAdviceElement.getName().trim().equals("pointcut-def")) {
                String pointcutName = null;
                String expression = null;
                PointcutType pointcutType = null;
                try {
                    for (Iterator it3 = nestedAdviceElement.attributeIterator(); it3.hasNext();) {
                        Attribute attribute = (Attribute)it3.next();
                        final String name = attribute.getName().trim();
                        final String value = attribute.getValue().trim();
View Full Code Here

                        final String value = attribute.getValue().trim();
                        if (name.equals("name")) {
                            pointcutDef.setName(value);
                        }
                        else if (name.equals("type")) {
                            PointcutType type = null;
                            String expression = nestedAdviceElement.attributeValue("pattern");
                            if (expression==null || expression.length()==0)
                                expression = nestedAdviceElement.attributeValue("expression");
                            if (value.equalsIgnoreCase(METHOD)) {
                                type = PointcutType.EXECUTION;
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.definition.expression.PointcutType

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.