Package com.asakusafw.vocabulary.flow.graph

Examples of com.asakusafw.vocabulary.flow.graph.OperatorDescription$Parameter


        MockOut<CharSequence> out = new MockOut<CharSequence>(CharSequence.class, "out");
        out.add(op);

        FlowElementOutput port = op.toOutputPort();
        FlowElement element = port.getOwner();
        OperatorDescription desc = (OperatorDescription) element.getDescription();
        List<Parameter> params = desc.getParameters();
        assertThat(params.size(), is(1));
        assertThat(params.get(0).getName(), is("param"));
        assertThat(params.get(0).getType(), is((Type) int.class));
        assertThat(params.get(0).getValue(), is((Object) 5));

        Declaration decl = desc.getDeclaration();
        assertThat(decl.getAnnotationType(), is((Type) MockOperator.class));
        assertThat(decl.getDeclaring().getName(), is("com.example.Concrete"));
        assertThat(decl.getImplementing().getName(), is("com.example.ConcreteImpl"));
        assertThat(decl.getName(), is("example"));
        assertThat(decl.getParameterTypes(), is((Object) Arrays.<Object>asList(
                String.class, int.class)));

        Graph<String> graph = toGraph(in);
        assertThat(graph.getConnected("in"), isJust(desc.getName()));
        assertThat(graph.getConnected(desc.getName()), isJust("out"));
    }
View Full Code Here


        private LineEndProcessor.Context createEndConext(
                Factor factorOrNull,
                Expression input) {
            assert input != null;

            OperatorDescription description;
            if (factorOrNull == null) {
                description = new OperatorDescription.Builder(Identity.class)
                    .declare(Void.class, Void.class, "")
                    .addInput("input", Object.class)
                    .addOutput("output", Object.class)
View Full Code Here

        Precondition.checkMustNotBeNull(description, "description"); //$NON-NLS-1$
        if (description.getKind() != FlowElementKind.OPERATOR) {
            return null;
        }

        OperatorDescription op = (OperatorDescription) description;
        return lines.get(op.getDeclaration().getAnnotationType());
    }
View Full Code Here

        Precondition.checkMustNotBeNull(description, "description"); //$NON-NLS-1$
        if (description.getKind() != FlowElementKind.OPERATOR) {
            return null;
        }

        OperatorDescription op = (OperatorDescription) description;
        return rendezvouses.get(op.getDeclaration().getAnnotationType());
    }
View Full Code Here

        static String toOperatorName(VisualElement node) {
            assert node != null;
            FlowElement element = node.getElement();
            assert element.getDescription().getKind() == FlowElementKind.OPERATOR;
            OperatorDescription desc = (OperatorDescription) element.getDescription();
            StringBuilder buf = new StringBuilder();
            buf.append("@");
            buf.append(desc.getDeclaration().getAnnotationType().getSimpleName());
            buf.append("\n");
            buf.append(desc.getName());
            return buf.toString();
        }
View Full Code Here

        assertThat(fragment.getOutputPorts().size(), is(1));
        assertThat(fragment.getFactors().size(), is(1));

        Factor factor = fragment.getFactors().get(0);
        assertThat(factor.getElement().getDescription(), instanceOf(OperatorDescription.class));
        OperatorDescription op = (OperatorDescription) factor.getElement().getDescription();
        assertThat(op.getDeclaration().getDeclaring(), is((Object) ExOperator.class));
    }
View Full Code Here

        assertThat(fragment.getOutputPorts().size(), is(1));
        assertThat(fragment.getFactors().size(), is(1));

        Factor factor = fragment.getFactors().get(0);
        assertThat(factor.getElement().getDescription(), instanceOf(OperatorDescription.class));
        OperatorDescription op = (OperatorDescription) factor.getElement().getDescription();
        assertThat(op.getDeclaration().getDeclaring(), is((Object) ExOperator.class));
    }
View Full Code Here

                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here

            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
                buffer.append(parameter.getName());
                commaNeeded = true;
            }
        }
        return buffer.toString();
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.vocabulary.flow.graph.OperatorDescription$Parameter

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.