Package org.andromda.translation.ocl.node

Examples of org.andromda.translation.ocl.node.AFeatureCallParameters


            if (isIterateDeclarator && !isDeclarator)
            {
                throw new OclParserException("Parser Error: Illegal feature call parameters format in \"" +
                        featureCallParameters + "\"; " + "must contain \";\" only if it contains \"|\"");
            }
            AFeatureCallParameters parameters;
            if (isIterateDeclarator)
            {
                parameters = getParametersWithIterateDeclarator(featureCallParameters,
                        featureCallParameters.getExpression(), parameterOption);
            }
View Full Code Here


                    featureCallParameterOption1.getExpression());
            iteratorDeclarator.setEqualExpression(equalExpression);
            iteratorDeclarator.setBar(featureCallParameterOption2.getBar());
            AActualParameterList params = new AActualParameterList(featureCallParameterOption2.getExpression(),
                    new ArrayList());
            return new AFeatureCallParameters(featureCallParameters.getLParen(), iteratorDeclarator, params,
                    featureCallParameters.getRParen());
        }
View Full Code Here

                    1];

            AStandardDeclarator standardDeclarator = new AStandardDeclarator(
                    this.getVariableDeclarationList(featureCallParameters), barParameterType.getBar());
            AActualParameterList params = new AActualParameterList(barParameterType.getExpression(), new ArrayList());
            return new AFeatureCallParameters(featureCallParameters.getLParen(), standardDeclarator, params,
                    featureCallParameters.getRParen());
        }
View Full Code Here

                ACommaExpression commaExpression = new ACommaExpression(commaOption.getComma(),
                        commaOption.getExpression());
                paramList.add(commaExpression);
            }

            return new AFeatureCallParameters(featureCallParameters.getLParen(), null,
                    new AActualParameterList(expr, paramList), featureCallParameters.getRParen());
        }
View Full Code Here

     *
     * @param featureCall the <strong>arrow</strong> <code>featureCall</code> to handle.
     */
    public void handleArrowFeatureCall(AFeatureCall featureCall)
    {
        AFeatureCallParameters params = (AFeatureCallParameters)featureCall.getFeatureCallParameters();
        AActualParameterList list = null;
        if (params != null)
        {
            list = (AActualParameterList)params.getActualParameterList();
        }
        boolean arrow = this.arrowPropertyCallStack.peek().equals(Boolean.TRUE) &&
                !String.valueOf(list).trim().equals("");
        {
            newTranslationLayer();
            final String navigationalPath = ConcreteSyntaxUtils.getArrowFeatureCallResultNavigationalPath(
                    (APropertyCallExpression)featureCall.parent().parent());
            // if the result of an arrow feature (collection operation) has a
            // navigational
            // path, retrieve it and wrap the current expression with an OCL
            // introspector call
            boolean resultNavigationalPath = StringUtils.isNotBlank(navigationalPath);
            if (resultNavigationalPath)
            {
                write(OCL_INTROSPECTOR_INVOKE_PREFIX);
            }
            write(OCL_TRANSLATOR_PACKAGE);
            write(".OCLCollections.");
            inAFeatureCall(featureCall);
            if (featureCall.getPathName() != null)
            {
                featureCall.getPathName().apply(this);
            }
            String featureCallName = TranslationUtils.trimToEmpty(featureCall.getPathName());
            AFeatureCallParameters parameters = (AFeatureCallParameters)featureCall.getFeatureCallParameters();
            if (parameters != null)
            {
                if (parameters.getLParen() != null)
                {
                    parameters.getLParen().apply(this);
                }
                mergeTranslationLayerBefore();
                AActualParameterList parameterList = (AActualParameterList)parameters.getActualParameterList();
                if (parameterList != null)
                {
                    List expressions = parameterList.getCommaExpression();
   
                    if (parameterList.getExpression() != null)
                    {
                        if (arrow)
                        {
                            write(",");
                            write(features.getProperty(featureCallName));
                            write(" ");
                            if (OCLPredicateFeatures.isPredicateFeature(featureCallName))
                            {
                                write(BOOLEAN_WRAP_PREFIX);
                            }
                        }
                        parameterList.getExpression().apply(this);
                    }
                    for (int ctr = 0; ctr < expressions.size(); ctr++)
                    {
                        Node expression = (Node)expressions.get(ctr);
                        if (expression != null)
                        {
                            write(",");
                            expression.apply(this);
                        }
                    }
                    if (parameterList.getExpression() != null)
                    {
                        if (OCLPredicateFeatures.isPredicateFeature(featureCallName))
                        {
                            write(BOOLEAN_WRAP_SUFFIX);
                        }
                        if (arrow)
                            write(";}}");
                    }
                }
                if (parameters.getRParen() != null)
                {
                    parameters.getRParen().apply(this);
                }
            }
            // now since we have a navigational path off of the
            // result we need to write the path and close off
            // the call to the OCL introspector.
View Full Code Here

TOP

Related Classes of org.andromda.translation.ocl.node.AFeatureCallParameters

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.