Examples of ASTParameter


Examples of org.codehaus.aspectwerkz.expression.ast.ASTParameter

                    // too many args in foo()
                    matchCount = -1;
                    break;
                }
                // do we have an eager wildcard in the middle ?
                ASTParameter parameterNode = (ASTParameter) parameterNodes.get(iexp + 1);
                boolean isEager = parameterNode.getDeclaringClassPattern().isEagerWildCard();
                if (isEager) {
                    // TODO - ignore for now, but not really supported - eager in the middle will match one
                }
                if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[ictx]))) {
                    matchCount += 1;
                    ictx++;
                } else {
                    // assume matched by starting ".." and rewind expression index
                    matchCount = 0;
                    ictx++;
                    iexp = -1;
                }
            }
            if (matchCount == expressionParameterCount) {
                return true;
            } else {
                return false;
            }
        } else if (isFirstArgEager) {
            expressionParameterCount--;
            if (contextParametersCount >= expressionParameterCount) {
                // do a match from last to first, break when foo() nodes are exhausted
                for (int i = 0; (i < contextParametersCount) && (expressionParameterCount - i >= 0); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(expressionParameterCount - i);
                    if (Boolean.TRUE.equals(
                            (Boolean) parameterNode.jjtAccept(
                                    this,
                                    parameterTypes[contextParametersCount - 1 - i]
                            )
                    )) {
                        ;//go on with "next" param
                    } else {
                        return false;
                    }
                }
                return true;
            } else {
                //foo() as more param than context we try to match
                return false;
            }
        } else if (isLastArgEager) {
            expressionParameterCount--;
            if (contextParametersCount >= expressionParameterCount) {
                // do a match from first to last, break when foo() nodes are exhausted
                for (int i = 0; (i < contextParametersCount) && (i < expressionParameterCount); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);
                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {
                        ;//go on with next param
                    } else {
                        return false;
                    }
                }
                return true;
            } else {
                return false;
            }
        } else {
            // no eager wildcard in foo()
            // check that param length are equals
            if (expressionParameterCount == contextParametersCount) {
                for (int i = 0; i < parameterNodes.size(); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);
                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {
                        ;//go on with next param
                    } else {
                        return false;
                    }
                }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ast.ASTParameter

                }

                // do we have an eager wildcard in the middle ?

                ASTParameter parameterNode = (ASTParameter) parameterNodes.get(iexp+1);

                boolean isEager = parameterNode.getDeclaringClassPattern().isEagerWildCard();

                if (isEager) {

                    // TODO - ignore for now, but not really supported - eager in the middle will match one

                }

                if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[ictx]))) {

                    matchCount += 1;

                    ictx++;

                } else {

                    // assume matched by starting ".." and rewind expression index

                    matchCount = 0;

                    ictx++;

                    iexp = -1;

                }

            }

            if (matchCount == expressionParameterCount) {

                return true;

            } else {

                return false;

            }

        } else if (isFirstArgEager) {

            expressionParameterCount--;

            if (contextParametersCount >= expressionParameterCount) {

                // do a match from last to first, break when foo() nodes are exhausted

                for (int i = 0; (i < contextParametersCount) && (expressionParameterCount - i >= 0); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(expressionParameterCount - i);

                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(

                            this,

                            parameterTypes[contextParametersCount -1 -i]))) {

                        ;//go on with "next" param

                    } else {

                        return false;

                    }

                }

                return true;

            } else {

                //foo() as more param than context we try to match

                return false;

            }

        } else if (isLastArgEager) {

            expressionParameterCount--;

            if (contextParametersCount >= expressionParameterCount) {

                // do a match from first to last, break when foo() nodes are exhausted

                for (int i = 0; (i < contextParametersCount) && (i < expressionParameterCount); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);

                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {

                        ;//go on with next param

                    } else {

                        return false;

                    }

                }

                return true;

            } else {

                return false;

            }

        } else {

            // no eager wildcard in foo()

            // check that param length are equals

            if (expressionParameterCount == contextParametersCount) {

                for (int i = 0; i < parameterNodes.size(); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);

                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {

                        ;//go on with next param

                    } else {
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ast.ASTParameter

            // if number of nodes is greater than the number of parameter types -> bail out
            // unless there is one single node with the eager wildcard pattern '..' -> parse
            if (parameterNodes.size() > parameterTypes.length) {
                if (parameterNodes.size() == 1) {
                    ASTParameter param = (ASTParameter) parameterNodes.get(0);
                    if (param.getDeclaringClassPattern().isEagerWildCard()) {
                        return true;
                    }
                }
                return false;
            }

            // iterate over the parameter nodes
            int j = 0;
            for (Iterator iterator = parameterNodes.iterator(); iterator.hasNext();) {
                ASTParameter parameter = (ASTParameter) iterator.next();
                if (parameter.getDeclaringClassPattern().isEagerWildCard()) {
                    return true;
                }
                if (Boolean.TRUE.equals(parameter.jjtAccept(this, parameterTypes[j++]))) {
                    continue;
                } else {
                    return false;
                }
            }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ast.ASTParameter

                }

                // do we have an eager wildcard in the middle ?

                ASTParameter parameterNode = (ASTParameter) parameterNodes.get(iexp + 1);

                boolean isEager = parameterNode.getDeclaringClassPattern().isEagerWildCard();

                if (isEager) {

                    // TODO - ignore for now, but not really supported - eager in the middle will match one

                }

                if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[ictx]))) {

                    matchCount += 1;

                    ictx++;

                } else {

                    // assume matched by starting ".." and rewind expression index

                    matchCount = 0;

                    ictx++;

                    iexp = -1;

                }

            }

            if (matchCount == expressionParameterCount) {

                return true;

            } else {

                return false;

            }

        } else if (isFirstArgEager) {

            expressionParameterCount--;

            if (contextParametersCount >= expressionParameterCount) {

                // do a match from last to first, break when foo() nodes are exhausted

                for (int i = 0; (i < contextParametersCount) && (expressionParameterCount - i >= 0); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(expressionParameterCount - i);

                    if (Boolean.TRUE.equals(

                            (Boolean) parameterNode.jjtAccept(

                                    this,

                                    parameterTypes[contextParametersCount - 1 - i]

                            )

                    )) {

                        ;//go on with "next" param

                    } else {

                        return false;

                    }

                }

                return true;

            } else {

                //foo() as more param than context we try to match

                return false;

            }

        } else if (isLastArgEager) {

            expressionParameterCount--;

            if (contextParametersCount >= expressionParameterCount) {

                // do a match from first to last, break when foo() nodes are exhausted

                for (int i = 0; (i < contextParametersCount) && (i < expressionParameterCount); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);

                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {

                        ;//go on with next param

                    } else {

                        return false;

                    }

                }

                return true;

            } else {

                return false;

            }

        } else {

            // no eager wildcard in foo()

            // check that param length are equals

            if (expressionParameterCount == contextParametersCount) {

                for (int i = 0; i < parameterNodes.size(); i++) {

                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);

                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {

                        ;//go on with next param

                    } else {
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ast.ASTParameter

                    // too many args in foo()
                    matchCount = -1;
                    break;
                }
                // do we have an eager wildcard in the middle ?
                ASTParameter parameterNode = (ASTParameter) parameterNodes.get(iexp + 1);
                boolean isEager = parameterNode.getDeclaringClassPattern().isEagerWildCard();
                if (isEager) {
                    // TODO - ignore for now, but not really supported - eager in the middle will match one
                }
                if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[ictx]))) {
                    matchCount += 1;
                    ictx++;
                } else {
                    // assume matched by starting ".." and rewind expression index
                    matchCount = 0;
                    ictx++;
                    iexp = -1;
                }
            }
            if (matchCount == expressionParameterCount) {
                return true;
            } else {
                return false;
            }
        } else if (isFirstArgEager) {
            expressionParameterCount--;
            if (contextParametersCount >= expressionParameterCount) {
                // do a match from last to first, break when foo() nodes are exhausted
                for (int i = 0; (i < contextParametersCount) && (expressionParameterCount - i >= 0); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(expressionParameterCount - i);
                    if (Boolean.TRUE.equals(
                            (Boolean) parameterNode.jjtAccept(
                                    this,
                                    parameterTypes[contextParametersCount - 1 - i]
                            )
                    )) {
                        ;//go on with "next" param
                    } else {
                        return false;
                    }
                }
                return true;
            } else {
                //foo() as more param than context we try to match
                return false;
            }
        } else if (isLastArgEager) {
            expressionParameterCount--;
            if (contextParametersCount >= expressionParameterCount) {
                // do a match from first to last, break when foo() nodes are exhausted
                for (int i = 0; (i < contextParametersCount) && (i < expressionParameterCount); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);
                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {
                        ;//go on with next param
                    } else {
                        return false;
                    }
                }
                return true;
            } else {
                return false;
            }
        } else {
            // no eager wildcard in foo()
            // check that param length are equals
            if (expressionParameterCount == contextParametersCount) {
                for (int i = 0; i < parameterNodes.size(); i++) {
                    ASTParameter parameterNode = (ASTParameter) parameterNodes.get(i);
                    if (Boolean.TRUE.equals((Boolean) parameterNode.jjtAccept(this, parameterTypes[i]))) {
                        ;//go on with next param
                    } else {
                        return false;
                    }
                }
View Full Code Here

Examples of org.jboss.aop.pointcut.ast.ASTParameter

         this.params = params;
      }
     
      boolean doMatch(int astIndex, int actualIndex)
      {
         ASTParameter ast = astParameters.get(astIndex);
         ClassExpression exp = ast.getType();

         if (exp.isSimple())
         {
            String asString = ClassExpression.simpleType(params[actualIndex]);
            if (!exp.matches(asString)) return false;
View Full Code Here

Examples of org.jboss.aop.pointcut.ast.ASTParameter

         this.params = params;
      }
     
      boolean doMatch(int astIndex, int actualIndex)
      {
         ASTParameter ast = astParameters.get(astIndex);
         ClassExpression exp = ast.getType();
         if (!matchesClassExpr(exp, params[actualIndex], advisor)) return false;
         return true;
      }
View Full Code Here

Examples of org.jboss.aop.pointcut.ast.ASTParameter

         this.params = params;
      }
     
      boolean doMatch(int astIndex, int actualIndex)
      {
         ASTParameter ast = astParameters.get(astIndex);
         ClassExpression exp = ast.getType();

         if (exp.isSimple())
         {
            String asString = ClassExpression.simpleType(params[actualIndex]);
            if (!exp.matches(asString)) return false;
View Full Code Here

Examples of org.jboss.aop.pointcut.ast.ASTParameter

         this.params = params;
      }
     
      boolean doMatch(int astIndex, int actualIndex)
      {
         ASTParameter ast = astParameters.get(astIndex);
         ClassExpression exp = ast.getType();
         if (!matchesClassExpr(exp, params[actualIndex], advisor)) return false;
         return true;
      }
View Full Code Here

Examples of org.jboss.aop.pointcut.ast.ASTParameter

         this.params = params;
      }
     
      boolean doMatch(int astIndex, int actualIndex)
      {
         ASTParameter ast = astParameters.get(astIndex);
         ClassExpression exp = ast.getType();

         if (exp.isSimple())
         {
            String asString = ClassExpression.simpleType(params[actualIndex]);
            if (!exp.matches(asString)) return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.