Package com.asakusafw.vocabulary.flow.graph.OperatorDescription

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


        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.Simple"));
        assertThat(decl.getImplementing().getName(), is("com.example.SimpleImpl"));
        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 void dumpFlowBody(Context context, String flowId, FlowGraph flow) {
        for (FlowElement element : FlowGraphUtil.collectElements(flow)) {
            FlowElementDescription desc = element.getDescription();
            switch (desc.getKind()) {
            case OPERATOR:
                Declaration decl = ((OperatorDescription) desc).getDeclaration();
                if (decl.getDeclaring().getName().startsWith("com.asakusafw.vocabulary.") == false) {
                    String elementId = context.label(
                            decl.toMethod(),
                            decl.getAnnotationType().getSimpleName(),
                            MessageFormat.format(
                                    "{0}#{1}",
                                    decl.getDeclaring().getSimpleName(),
                                    decl.toMethod().getName()));
                    context.connect(flowId, elementId);
                }
                break;
            case FLOW_COMPONENT:
                FlowPartDescription part = (FlowPartDescription) desc;
View Full Code Here

    private String dumpFactor(Context context, Factor factor) {
        FlowElementDescription desc = factor.getElement().getDescription();
        switch (desc.getKind()) {
        case OPERATOR:
            Declaration decl = ((OperatorDescription) desc).getDeclaration();
            if (decl.getDeclaring().getName().startsWith("com.asakusafw.vocabulary.") == false) {
                String id = context.label(
                        decl.toMethod(),
                        decl.getAnnotationType().getSimpleName(),
                        MessageFormat.format(
                                "{0}#{1}",
                                decl.getDeclaring().getSimpleName(),
                                decl.toMethod().getName()));
                return id;
            }
            return null;
        case FLOW_COMPONENT:
        case INPUT:
View Full Code Here

        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

TOP

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

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.