Package com.asakusafw.utils.java.model.util

Examples of com.asakusafw.utils.java.model.util.AttributeBuilder


    }

    private FieldDeclaration createStageOutputsField() {
        FieldDeclaration field = factory.newFieldDeclaration(
                null,
                new AttributeBuilder(factory)
                    .Private()
                    .toAttributes(),
                importer.toType(StageOutputDriver.class),
                stageOutputs,
                null);
View Full Code Here


        assert node != null;
        assert value != null;
        Type type = importer.resolve(factory.newNamedType(value.getCompiled().getQualifiedName()));
        return factory.newFieldDeclaration(
                null,
                new AttributeBuilder(factory)
                    .Private()
                    .toAttributes(),
                type,
                node.getName(),
                null);
View Full Code Here

                    .newObject(arguments)
                    .toExpression())
                .toStatement();
        } else {
            return factory.newLocalVariableDeclaration(
                    new AttributeBuilder(factory)
                        .Final()
                        .toAttributes(),
                    type,
                    Collections.singletonList(factory.newVariableDeclarator(
                            node.getName(),
View Full Code Here

        Type dataType = importer.toType(model.getType());

        SimpleName cacheName = names.create("cache");
        FieldDeclaration cache = factory.newFieldDeclaration(
                null,
                new AttributeBuilder(factory)
                    .Private()
                    .toAttributes(),
                dataType,
                cacheName,
                model.createNewInstance(dataType));

        SimpleName argumentName = names.create("arg");
        List<Statement> statements = Lists.create();
        Iterator<FragmentNode> iter = downstream.iterator();
        while (iter.hasNext()) {
            FragmentNode node = iter.next();
            if (iter.hasNext()) {
                statements.add(model.assign(cacheName, argumentName));
                statements.add(new ExpressionBuilder(factory, node.getName())
                    .method(FlowElementProcessor.RESULT_METHOD_NAME, cacheName)
                    .toStatement());
            } else {
                statements.add(new ExpressionBuilder(factory, node.getName())
                    .method(FlowElementProcessor.RESULT_METHOD_NAME, argumentName)
                    .toStatement());
            }
        }

        MethodDeclaration result = factory.newMethodDeclaration(
                null,
                new AttributeBuilder(factory)
                    .annotation(importer.toType(Override.class))
                    .Public()
                    .toAttributes(),
                factory.newBasicType(BasicTypeKind.VOID),
                factory.newSimpleName(FlowElementProcessor.RESULT_METHOD_NAME),
View Full Code Here

        assert node != null;
        assert context != null;
        assert value != null;
        Type type = importer.toType(value.getCompiled().getMapOutputType().getQualifiedName());
        return factory.newLocalVariableDeclaration(
                new AttributeBuilder(factory)
                    .Final()
                    .toAttributes(),
                type,
                Collections.singletonList(factory.newVariableDeclarator(
                        node.getName(),
View Full Code Here

        assert value != null;
        Type type = importer.resolve(factory.newParameterizedType(
                Models.toType(factory, Result.class),
                Models.toType(factory, value.getType())));
        return factory.newLocalVariableDeclaration(
                new AttributeBuilder(factory)
                    .Final()
                    .toAttributes(),
                type,
                Collections.singletonList(factory.newVariableDeclarator(
                        node.getName(),
View Full Code Here

            members.add(createPartition());
            members.add(createHashCode());
            members.add(ShuffleEmiterUtil.createPortToElement(factory, model));
            return factory.newClassDeclaration(
                    createJavadoc(),
                    new AttributeBuilder(factory)
                        .annotation(t(SuppressWarnings.class), v("deprecation"))
                        .Public()
                        .Final()
                        .toAttributes(),
                    name,
View Full Code Here

        return util.getFactoryName(operatorClass.getElement());
    }

    @Override
    protected List<? extends Attribute> getAttribuets() {
        return new AttributeBuilder(factory)
            .annotation(util.t(Generated.class), util.v("{0}:{1}",
                    getClass().getSimpleName(),
                    OperatorCompiler.VERSION))
            .annotation(util.t(OperatorFactory.class),
                    factory.newClassLiteral(util.t(operatorClass.getElement())))
View Full Code Here

                .apply(InfixOperator.REMAINDER, partitions)
                .toReturnStatement());

            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(t(Override.class))
                        .Public()
                        .toAttributes(),
                    t(int.class),
                    factory.newSimpleName("getPartition"),
View Full Code Here

            statements.add(new ExpressionBuilder(factory, result)
                .toReturnStatement());

            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .Private()
                        .toAttributes(),
                    t(int.class),
                    factory.newSimpleName(HASH_CODE_METHOD_NAME),
                    Collections.singletonList(
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.java.model.util.AttributeBuilder

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.