Examples of newThis()


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

                    .Public()
                    .toAttributes(),
                context.resolve(String.class),
                f.newSimpleName(name.toMemberName()),
                Collections.<FormalParameterDeclaration>emptyList(),
                Collections.singletonList(new ExpressionBuilder(f, f.newThis())
                    .field(context.getFieldName(property))
                    .method("getAsString")
                    .toReturnStatement()));
    }
View Full Code Here

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

                Arrays.asList(new FormalParameterDeclaration[] {
                        f.newFormalParameterDeclaration(
                                context.resolve(String.class),
                                paramName)
                }),
                Collections.singletonList(new ExpressionBuilder(f, f.newThis())
                    .field(context.getFieldName(property))
                    .method("modify", paramName)
                    .toStatement()));
    }
View Full Code Here

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

                .method("append", //$NON-NLS-1$
                        Models.toLiteral(f,
                                MessageFormat.format(", {0}=", context.getFieldName(property)))) //$NON-NLS-1$
                .toStatement());
            statements.add(new ExpressionBuilder(f, buffer)
                .method("append", new ExpressionBuilder(f, f.newThis()) //$NON-NLS-1$
                    .field(context.getFieldName(property))
                    .toExpression())
                .toStatement());
        }
        statements.add(new ExpressionBuilder(f, buffer)
View Full Code Here

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

        assert model != null;
        ModelFactory f = context.getModelFactory();
        List<Statement> statements = Lists.create();
        SimpleName obj = context.createVariableName("obj"); //$NON-NLS-1$
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, f.newThis())
                    .apply(InfixOperator.EQUALS, obj)
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, true)))));
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, obj)
View Full Code Here

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

                new ExpressionBuilder(f, obj)
                    .apply(InfixOperator.EQUALS, Models.toNullLiteral(f))
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, f.newThis())
                    .method("getClass") //$NON-NLS-1$
                    .apply(InfixOperator.NOT_EQUALS, new ExpressionBuilder(f, obj)
                        .method("getClass") //$NON-NLS-1$
                        .toExpression())
                    .toExpression(),
View Full Code Here

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

            .castTo(self)
            .toLocalVariableDeclaration(self, other));
        for (PropertyDeclaration property : model.getDeclaredProperties()) {
            SimpleName field = context.getFieldName(property);
            statements.add(f.newIfStatement(
                    new ExpressionBuilder(f, f.newThis())
                        .field(field)
                        .method("equals", new ExpressionBuilder(f, other) //$NON-NLS-1$
                            .field(field)
                            .toExpression())
                        .apply(InfixOperator.EQUALS, Models.toLiteral(f, false))
View Full Code Here

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

        assert context != null;
        assert model != null;
        assert sid != null;
        ModelFactory f = context.getModelFactory();
        List<Statement> statements = Lists.create();
        statements.add(new ExpressionBuilder(f, f.newThis())
            .method(context.getValueGetterName(sid.findDeclaration()))
            .toReturnStatement());
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
View Full Code Here

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

        List<Statement> statements = Lists.create();
        if (deleteFlagOrNull == null) {
            statements.add(new ExpressionBuilder(f, Models.toLiteral(f, false))
                .toReturnStatement());
        } else {
            statements.add(new ExpressionBuilder(f, f.newThis())
                .method(context.getOptionGetterName(deleteFlagOrNull.findDeclaration()))
                .method("has", f.newSimpleName(FIELD_DELETE_FLAG_VALUE))
                .toReturnStatement());
        }
        return f.newMethodDeclaration(
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.