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

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


            List<Statement> statements = Lists.create();
            statements.add(new ExpressionBuilder(factory, Models.toLiteral(factory, slot.getName()))
                .toReturnStatement());
            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(importer.toType(Override.class))
                        .Public()
                        .toAttributes(),
                    importer.toType(String.class),
                    factory.newSimpleName(PreparatorMapper.NAME_GET_OUTPUT_NAME),
View Full Code Here


     * @throws IllegalArgumentException if some parameters were {@code null}
     */
    public FormalParameterDeclaration toFactoryMethodInput(OperatorPortDeclaration var, SimpleName name) {
        Precondition.checkMustNotBeNull(var, "var"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(name, "name"); //$NON-NLS-1$
        AttributeBuilder attributes = new AttributeBuilder(factory);
        ShuffleKey key = var.getShuffleKey();
        if (key != null) {
            List<Expression> group = new ArrayList<Expression>();
            for (String entry : key.getGroupProperties()) {
                group.addAll(new AttributeBuilder(factory)
                        .annotation(t(KeyInfo.Group.class), "expression", Models.toLiteral(factory, entry))
                        .toAnnotations());
            }
            List<Expression> order = new ArrayList<Expression>();
            for (ShuffleKey.Order entry : key.getOrderings()) {
                order.addAll(new AttributeBuilder(factory)
                        .annotation(
                                t(KeyInfo.Order.class),
                                "direction", new TypeBuilder(factory, t(KeyInfo.Direction.class))
                                        .field(entry.getDirection().name())
                                        .toExpression(),
                                "expression", Models.toLiteral(factory, entry.getProperty()))
                        .toAnnotations());
            }

            attributes.annotation(
                    t(KeyInfo.class),
                    "group", factory.newArrayInitializer(group),
                    "order", factory.newArrayInitializer(order));
        }
        return factory.newFormalParameterDeclaration(
                attributes.toAttributes(),
                toSourceType(var.getType().getRepresentation()),
                false,
                name,
                0);
    }
View Full Code Here

            importer.resolvePackageMember(name);
            return factory.newClassDeclaration(
                    new JavadocBuilder(factory)
                        .text("エピローグ用のレデューサー。")
                        .toJavadoc(),
                    new AttributeBuilder(factory)
                        .annotation(importer.toType(TraceLocation.class), createTraceLocationElements())
                        .Public()
                        .toAttributes(),
                    name,
                    Collections.<TypeParameterDeclaration>emptyList(),
View Full Code Here

            }
            statements.add(new ExpressionBuilder(factory, resultName)
                .toReturnStatement());
            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(importer.toType(Override.class))
                        .Protected()
                        .toAttributes(),
                    importer.toType(String[].class),
                    factory.newSimpleName(SlotSorter.NAME_GET_OUTPUT_NAMES),
View Full Code Here

            }
            statements.add(new ExpressionBuilder(factory, resultName)
                .toReturnStatement());
            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(importer.toType(Override.class))
                        .Protected()
                        .toAttributes(),
                    importer.toType(Writable[].class),
                    factory.newSimpleName(SlotSorter.NAME_CREATE_SLOT_OBJECTS),
View Full Code Here

            members.add(createStageOutputPath());
            members.add(createStageInputsMethod());
            members.add(createStageOutputsMethod());
            return factory.newClassDeclaration(
                    createJavadoc(),
                    new AttributeBuilder(factory)
                        .annotation(importer.toType(TraceLocation.class), createTraceLocationElements())
                        .Public()
                        .Final()
                        .toAttributes(),
                    name,
View Full Code Here

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

            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(t(Override.class))
                        .Protected()
                        .toAttributes(),
                    t(List.class, t(StageInput.class)),
                    factory.newSimpleName(AbstractStageClient.METHOD_STAGE_INPUTS),
View Full Code Here

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

            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(t(Override.class))
                        .Protected()
                        .toAttributes(),
                    t(List.class, t(StageOutput.class)),
                    factory.newSimpleName(AbstractStageClient.METHOD_STAGE_OUTPUTS),
View Full Code Here

            members.addAll(extraFields);
            members.add(ctor);
            members.addAll(methods);
            return factory.newClassDeclaration(
                    createJavadoc(),
                    new AttributeBuilder(factory)
                        .annotation(t(TraceLocation.class), createTraceLocationElements())
                        .annotation(t(SuppressWarnings.class), v("deprecation"))
                        .Public()
                        .Final()
                        .toAttributes(),
View Full Code Here

                String methodName,
                Type returnType,
                Expression expression) {
            return factory.newMethodDeclaration(
                    null,
                    new AttributeBuilder(factory)
                        .annotation(t(Override.class))
                        .Protected()
                        .toAttributes(),
                    returnType,
                    factory.newSimpleName(methodName),
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.