Examples of ExpressionInfo


Examples of com.habitsoft.kiyaa.rebind.typeinfo.ExpressionInfo

                        String setterName = "set" + capitalize(id);
                        memberDecls.add("public final void "+ setterName + "(String newValue) { panel.setText(\"" + id + "\", newValue); }");
                        myClass.addMethod(setterName, PrimitiveTypeInfo.VOID, RuntimeClassWrapper.STRING);
                       
                        //System.out.println("Using string build expression: "+stringBuildExpr+" for "+text);
                    ExpressionInfo expr = findAccessors(stringBuildExpr.toString(), true, true);
                    if(expr == null) {
                      logger.log(TreeLogger.ERROR, "Unable to resolve expression: "+stringBuildExpr, null);
                      throw new UnableToCompleteException();
                    }
                        //System.out.println("Got getter: "+expr.getter);
                    ExpressionInfo textExpr = new ExpressionInfo(expr.getOriginalExpr(), id, setterName, RuntimeClassWrapper.STRING);
                    if((expr.isConstant() || areConstant) && expr.hasSynchronousGetter()) {
                      sw.println(textExpr.copyStatement(expr));
                    } else if(areEarly) {
                        if(expr.hasSynchronousGetter())
                            earlyLoads.add(textExpr.copyStatement(expr));
                        else
                            earlyAsyncLoads.add(textExpr.asyncCopyStatement(expr, "group.<Void>member()", true));
                    } else {
                      asyncLoads.add(textExpr.asyncCopyStatement(expr, "group.<Void>member()", true));
                    }
                  }
              } finally {
                popLogger();
              }
View Full Code Here

Examples of jmathexpr.util.logging.ExpressionInfo

    @Override
    public void dump(List<ExpressionInfo> dump, ExpressionInfo info) {
        dump.add(info);
       
        List<Expression> children = getChildren();
        ExpressionInfo childInfo = null;
       
        for (Expression c : children) {
            if (childInfo == null) {
                childInfo = info.firstChild(c);
            } else {
                childInfo = childInfo.nextSibling(c);
            }
           
            c.dump(dump, childInfo);
        }
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

     * @return
     */
    public Object visit(ASTCflow node, Object data) {
        int cflowID = node.hashCode();
        Node subNode = node.jjtGetChild(0);
        ExpressionInfo subExpression = new ExpressionInfo(subNode, m_namespace);
        subExpression.inheritPossibleArgumentFrom(m_expressionInfo);
        ((List)data).add(new CflowBinding(cflowID, subExpression, false));
        return data;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

     * @return
     */
    public Object visit(ASTCflowBelow node, Object data) {
        int cflowID = node.hashCode();
        Node subNode = node.jjtGetChild(0);
        ExpressionInfo subExpression = new ExpressionInfo(subNode, m_namespace);
        subExpression.inheritPossibleArgumentFrom(m_expressionInfo);
        ((List)data).add(new CflowBinding(cflowID, subExpression, true));
        return data;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

        // do a lookup first to avoid infinite recursion when:
        // <pointcut name="pc" ...> [will be registered as pc]
        // <advice bind-to="pc" ...> [will be registered as pc and should not override previous one !]
        ExpressionNamespace namespace = ExpressionNamespace.getNamespace(aspectDef.getQualifiedName());
        ExpressionInfo info = namespace.getExpressionInfoOrNull(pointcutName);
        if (info == null) {
            info = new ExpressionInfo(expression, aspectDef.getQualifiedName());
            // extract the pointcut signature map
            if (pointcutCallSignature != null) {
                String[] parameters = Strings.splitString(pointcutCallSignature, ",");
                for (int i = 0; i < parameters.length; i++) {
                    String[] parameterInfo = Strings.splitString(
                            Strings.replaceSubString(parameters[i].trim(), "  ", " "),
                            " "
                    );
                    info.addArgument(parameterInfo[1], parameterInfo[0], aspectDef.getClassInfo().getClassLoader());
                }
            }
        }
        ExpressionNamespace.getNamespace(aspectDef.getQualifiedName()).addExpressionInfo(pointcutName, info);
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

    public static void createAndAddAdvisableDef(final String expression, final SystemDefinition systemDef) {
        AspectDefinition virtualAspectDef = systemDef.getAspectDefinition(Virtual.class.getName());
        virtualAspectDef.addPointcutDefinition(new PointcutDefinition(expression));

        AdviceDefinition virtualAdviceDef = (AdviceDefinition) virtualAspectDef.getBeforeAdviceDefinitions().get(0);
        ExpressionInfo oldExpressionInfo = virtualAdviceDef.getExpressionInfo();
        String newExpression;
        if (oldExpressionInfo != null) {
            String oldExpression = oldExpressionInfo.toString();
            newExpression = oldExpression + " || " + expression;
        } else {
            newExpression = expression;
        }

        virtualAdviceDef.setExpressionInfo(
                new ExpressionInfo(
                        newExpression,
                        virtualAspectDef.getQualifiedName()
                )
        );
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

        final AdviceDefinition virtualAdviceDef = (AdviceDefinition) virtualAspectDef.getBeforeAdviceDefinitions().get(
                0
        );

        final StringBuffer newExpression = new StringBuffer();
        final ExpressionInfo oldExpressionInfo = virtualAdviceDef.getExpressionInfo();
        if (oldExpressionInfo != null) {
            String oldExpression = oldExpressionInfo.toString();
            newExpression.append(oldExpression);
        }
        final Collection deploymentScopes = systemDef.getDeploymentScopes();
        if (deploymentScopes.size() != 0 && oldExpressionInfo != null) {
            newExpression.append(" || ");
        }
        for (Iterator it = deploymentScopes.iterator(); it.hasNext();) {
            DeploymentScope deploymentScope = (DeploymentScope) it.next();
            newExpression.append(deploymentScope.getExpression());
            if (it.hasNext()) {
                newExpression.append(" || ");
            }
        }
        if (newExpression.length() != 0) {
            virtualAdviceDef.setExpressionInfo(
                    new ExpressionInfo(
                            newExpression.toString(),
                            virtualAspectDef.getQualifiedName()
                    )
            );
        }
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

                                                          final String specialArgumentType,
                                                          final String aspectName,
                                                          final String aspectClassName,
                                                          final MethodInfo methodInfo,
                                                          final AspectDefinition aspectDef) {
        ExpressionInfo expressionInfo = new ExpressionInfo(
                expression,
                aspectDef.getQualifiedName()
        );

        // support for pointcut signature
        String adviceCallSignature = null;
        String resolvedSpecialArgumentType = specialArgumentType;
        if (adviceName.indexOf('(') > 0) {
            adviceCallSignature = adviceName.substring(adviceName.indexOf('(') + 1, adviceName.lastIndexOf(')'));
            String[] parameters = Strings.splitString(adviceCallSignature, ",");
            for (int i = 0; i < parameters.length; i++) {
                String[] parameterInfo = Strings.splitString(
                        Strings.replaceSubString(parameters[i].trim(), "  ", " "),
                        " "
                );
                // Note: for XML defined aspect, we support anonymous parameters like
                // advice(JoinPoint, Rtti) as well as abbreviations, so we have to assign
                // them a name here, as well as their real type
                String paramName, paramType = null;
                if (parameterInfo.length == 2) {
                    paramName = parameterInfo[1];
                    paramType = parameterInfo[0];
                    //FIXME -- ?? what ??
                } else {
                    paramName = "anonymous_" + i;
                    paramType = (String) Pattern.ABBREVIATIONS.get(parameterInfo[0]);
                }
                // skip the parameter if this ones is a after returning / throwing binding
                if (paramName.equals(specialArgumentType)) {
                    resolvedSpecialArgumentType = paramType;
                    expressionInfo.setSpecialArgumentName(paramName);
                } else {
                    expressionInfo.addArgument(paramName, paramType, aspectDef.getClassInfo().getClassLoader());
                }
            }
        }

        // check that around advice return Object else the compiler will fail
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

                                                        final DeploymentModel deploymentModel,
                                                        final boolean isTransient,
                                                        final SystemDefinition systemDef) {
        final MixinDefinition mixinDef = new MixinDefinition(mixinClassInfo, deploymentModel, isTransient, systemDef);
        if (expression != null) {
            ExpressionInfo expressionInfo = new ExpressionInfo(expression, systemDef.getUuid());

            // auto-name the pointcut which is anonymous for introduction
            ExpressionNamespace.getNamespace(systemDef.getUuid()).addExpressionInfo(
                    EXPRESSION_PREFIX + expression.hashCode(),
                    expressionInfo
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo

                                                                                        final AspectDefinition aspectDef) {
        final InterfaceIntroductionDefinition introDef = new InterfaceIntroductionDefinition(
                introductionName, interfaceClassName
        );
        if (expression != null) {
            ExpressionInfo expressionInfo = new ExpressionInfo(expression, aspectDef.getQualifiedName());

            // auto-name the pointcut which is anonymous for introduction
            ExpressionNamespace.getNamespace(aspectDef.getQualifiedName()).addExpressionInfo(
                    EXPRESSION_PREFIX + expression.hashCode(),
                    expressionInfo
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.