Package com.asakusafw.vocabulary.flow.graph

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


        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

TOP

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

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.