Package com.asakusafw.vocabulary.flow.graph

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


     * @return 追加した要素
     */
    public FlowElement defineFlowPart(
            String name,
            FlowGraph graph) {
        FlowElementDescription desc = new FlowPartDescription(graph);
        return register(name, desc);
    }
View Full Code Here


        Set<InputDescription> saw = Sets.create();
        List<Import> results = Lists.create();
        for (FlowBlock.Output source : graph.getInput().getBlockOutputs()) {
            FlowElement element = source.getElementPort().getOwner();
            FlowElementDescription desc = element.getDescription();
            if (desc.getKind() != FlowElementKind.INPUT) {
                error("{0}は入力を表現していません", desc);
                continue;
            }
            InputDescription description = (InputDescription) desc;
            saw.add(description);
View Full Code Here

        LOG.debug("出力を解析しています({})", graph.getOutput());

        List<Export> results = Lists.create();
        for (FlowBlock.Input target : graph.getOutput().getBlockInputs()) {
            FlowElement element = target.getElementPort().getOwner();
            FlowElementDescription desc = element.getDescription();
            if (desc.getKind() != FlowElementKind.OUTPUT) {
                error("{0}は出力を表現していません", desc);
                continue;
            }
            OutputDescription description = (OutputDescription) desc;
            ExternalIoDescriptionProcessor proc = environment.getExternals().findProcessor(description);
View Full Code Here

        return id;
    }

    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(),
View Full Code Here

    private void writeFlow(Context context, FlowGraph flow) {
        context.put("flow: {0}", flow.getDescription().getName());
        context.push();
        for (FlowElement element : FlowGraphUtil.collectElements(flow)) {
            FlowElementDescription desc = element.getDescription();
            switch (desc.getKind()) {
            case INPUT:
            case OUTPUT:
            case OPERATOR:
                context.put("{0}: {1}", desc.getKind().name().toLowerCase(), desc.toString());
                break;
            case FLOW_COMPONENT:
                writeFlow(context, ((FlowPartDescription) desc).getFlowGraph());
                break;
            case PSEUD:
View Full Code Here

    private void writeFragments(Context context, List<Fragment> fragments) {
        for (Fragment fragment : fragments) {
            context.put("fragment: {0}", name(fragment.getCompiled().getQualifiedName()));
            context.push();
            for (Factor factor : fragment.getFactors()) {
                FlowElementDescription description = factor.getElement().getDescription();
                if (description.getKind() != FlowElementKind.PSEUD) {
                    context.put("{0}: {1}", description.getKind().name().toLowerCase(), description);
                    context.push();
                    for (FlowResourceDescription resource : factor.getElement().getDescription().getResources()) {
                        for (InputDescription input : resource.getSideDataInputs()) {
                            context.put("side-data: {0} ({1})",
                                    input.getName(),
View Full Code Here

    }

    private Graph<FlowElementDescription> toDescription(Graph<FlowElement> graph) {
        Graph<FlowElementDescription> descriptions = Graphs.newInstance();
        for (Graph.Vertex<FlowElement> vertex : graph) {
            FlowElementDescription from = vertex.getNode().getDescription();
            for (FlowElement to : vertex.getConnected()) {
                descriptions.addEdge(from, to.getDescription());
            }
        }
        return descriptions;
View Full Code Here

            return false;
        }
        if (FlowGraphUtil.isBoundary(element)) {
            return false;
        }
        FlowElementDescription desc = element.getDescription();
        if (desc.getKind() == FlowElementKind.PSEUD) {
            return true;
        } else if (desc.getKind() == FlowElementKind.OPERATOR) {
            OperatorDescription op = (OperatorDescription) desc;
            Class<? extends Annotation> kind = op.getDeclaration().getAnnotationType();
            if (kind == Branch.class
                    || kind == Split.class
                    || kind == Project.class
View Full Code Here

        return results;
    }

    private boolean isFragmentEnd(FlowElement element) {
        assert element != null;
        FlowElementDescription description = element.getDescription();
        if (description.getKind() == FlowElementKind.PSEUD) {
            return false;
        }
        assert description.getKind() == FlowElementKind.OPERATOR;
        FlowElementProcessor.Repository repo = environment.getProcessors();
        FlowElementProcessor processor = repo.findProcessor(description);
        if (processor == null) {
            error("{0}に対するプロセッサが見つかりません", description);
            return false;
View Full Code Here

    }

    private Factor getFactor(FlowElement element) {
        assert element != null;
        FlowElementProcessor.Repository repo = environment.getProcessors();
        FlowElementDescription description = element.getDescription();
        if (description.getKind() == FlowElementKind.PSEUD) {
            return new Factor(element, repo.getEmptyProcessor());
        }
        FlowElementProcessor processor = repo.findProcessor(description);
        if (processor == null) {
            error("{0}に対するプロセッサが見つかりません", description);
View Full Code Here

TOP

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

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.