Package com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor

Examples of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo


            return port.getDescription().getDataType();
        }

        @Override
        public SourceInfo getInputInfo() {
            return new SourceInfo(locations, TemporaryInputFormat.class);
        }
View Full Code Here


                .toLocalVariableDeclaration(t(List.class, t(StageInput.class)), list));
            statements.add(new ExpressionBuilder(factory, Models.toNullLiteral(factory))
                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (CopyDescription slot : slots) {
                SourceInfo info = slot.getInput();
                Type mapperType = generateMapper(slot);
                Type formatClass = t(info.getFormat());
                statements.add(new ExpressionBuilder(factory, attributes)
                    .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
                        .newObject()
                        .toExpression())
                    .toStatement());
                for (Map.Entry<String, String> entry : info.getAttributes().entrySet()) {
                    statements.add(new ExpressionBuilder(factory, attributes)
                        .method("put",
                                Models.toLiteral(factory, entry.getKey()),
                                Models.toLiteral(factory, entry.getValue()))
                        .toStatement());
                }
                for (Location input : info.getLocations()) {
                    statements.add(new ExpressionBuilder(factory, list)
                        .method("add", new TypeBuilder(factory, t(StageInput.class))
                            .newObject(
                                    Models.toLiteral(factory, input.toPath(PATH_SEPARATOR)),
                                    factory.newClassLiteral(formatClass),
View Full Code Here

                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (Process process : stage.getProcesses()) {
                Expression mapperType = dotClass(process.getMapperTypeName());
                for (Source source : process.getResolvedSources()) {
                    SourceInfo info = source.getInputInfo();
                    Class<?> inputFormatType = info.getFormat();
                    statements.add(new ExpressionBuilder(factory, attributes)
                        .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
                            .newObject()
                            .toExpression())
                        .toStatement());
                    for (Map.Entry<String, String> entry : info.getAttributes().entrySet()) {
                        statements.add(new ExpressionBuilder(factory, attributes)
                            .method("put",
                                    Models.toLiteral(factory, entry.getKey()),
                                    Models.toLiteral(factory, entry.getValue()))
                            .toStatement());
                    }
                    for (Location location : info.getLocations()) {
                        statements.add(new ExpressionBuilder(factory, list)
                            .method("add", new TypeBuilder(factory, t(StageInput.class))
                                .newObject(
                                        Models.toLiteral(factory, location.toPath('/')),
                                        factory.newClassLiteral(t(inputFormatType)),
View Full Code Here

        resolver.resolve(Arrays.asList(slot));
        assertThat(environment.hasError(), is(true));
    }

    private SourceInfo input(String path) {
        return new SourceInfo(Collections.singleton(Location.fromPath(path, '/')), TemporaryInputFormat.class);
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo

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.