Examples of newMethodDeclaration()


Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

            SimpleName fieldName = context.getFieldName(property);
            statements.add(new ExpressionBuilder(f, fieldName)
                .method("write", parameter) //$NON-NLS-1$
                .toStatement());
        }
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

            SimpleName fieldName = context.getFieldName(property);
            statements.add(new ExpressionBuilder(f, fieldName)
                .method("readFields", parameter) //$NON-NLS-1$
                .toStatement());
        }
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

public class HelloDriver extends JavaDataModelDriver {

    @Override
    public List<MethodDeclaration> getMethods(EmitContext context, ModelDeclaration model) {
        ModelFactory f = context.getModelFactory();
        return Collections.singletonList(f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .Public()
                    .toAttributes(),
                context.resolve(String.class),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

                        .toExpression(),
                    f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        }
        statements.add(f.newReturnStatement(Models.toLiteral(f, true)));

        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

        JavaName name = JavaName.of(property.getName());
        name.addFirst("get");
        name.addLast("as");
        name.addLast("string");
        ModelFactory f = context.getModelFactory();
        return f.newMethodDeclaration(
                new JavadocBuilder(f)
                    .text("{0}を返す。",
                            context.getDescription(property))
                    .returns()
                        .text("{0}",
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

        name.addLast("string");
        ModelFactory f = context.getModelFactory();
        SimpleName paramName = context.createVariableName(
                context.getFieldName(property).getToken());

        return f.newMethodDeclaration(
                new JavadocBuilder(f)
                    .text("{0}を設定する。",
                            context.getDescription(property))
                    .param(paramName)
                        .text("設定する値",
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

            .method("append", Models.toLiteral(f, "}")) //$NON-NLS-1$ //$NON-NLS-2$
            .toStatement());
        statements.add(new ExpressionBuilder(f, buffer)
            .method("toString") //$NON-NLS-1$
            .toReturnStatement());
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

                    .toExpression())
                .toStatement());
        }
        statements.add(f.newReturnStatement(result));

        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

        assert trait != null;
        ModelFactory f = context.getModelFactory();
        List<Statement> statements = Lists.create();
        statements.add(new ExpressionBuilder(f, Models.toLiteral(f, computeModelVersion(context, model, trait)))
            .toReturnStatement());
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newMethodDeclaration()

        ModelFactory f = context.getModelFactory();
        String name = OriginalNameEmitter.getOriginalName(timestamp.findDeclaration());
        List<Statement> statements = Lists.create();
        statements.add(new ExpressionBuilder(f, Models.toLiteral(f, name))
            .toReturnStatement());
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.