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

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


                objectType);
        return factory.newClassDeclaration(
                new JavadocBuilder(factory)
                    .inline(descriptor.getDocumentation())
                    .toJavadoc(),
                new AttributeBuilder(factory)
                    .Public()
                    .Static()
                    .Final()
                    .toAttributes(),
                name,
View Full Code Here


                    .exception(util.t(IllegalArgumentException.class))
                        .text("引数に")
                        .code("null")
                        .text("が指定された場合")
                    .toJavadoc(),
                new AttributeBuilder(factory)
                    .Public()
                    .toAttributes(),
                objectType,
                factory.newSimpleName("as"),
                Collections.singletonList(factory.newFormalParameterDeclaration(
View Full Code Here

    private FieldDeclaration createResolverField(Context context) {
        assert context != null;
        return factory.newFieldDeclaration(
                null,
                new AttributeBuilder(factory)
                    .Private()
                    .Final()
                    .toAttributes(),
                util.t(FlowElementResolver.class),
                factory.newSimpleName(RESOLVER_FIELD_NAME),
View Full Code Here

        assert var != null;
        return factory.newFieldDeclaration(
                new JavadocBuilder(factory)
                    .inline(var.getDocumentation())
                    .toJavadoc(),
                new AttributeBuilder(factory)
                    .Public()
                    .Final()
                    .toAttributes(),
                util.toSourceType(var.getType().getRepresentation()),
                factory.newSimpleName(context.names.reserve(var.getName())),
View Full Code Here

        List<FormalParameterDeclaration> parameters = createParametersForConstructor(context, descriptor);
        List<Statement> statements = createBodyForConstructor(context, descriptor, parameters);
        return factory.newConstructorDeclaration(
                null,
                new AttributeBuilder(factory).toAttributes(),
                objectType.getName().getLastSegment(),
                parameters,
                statements);
    }
View Full Code Here

                descriptor.getName(),
                rawParameterTypes);

        return factory.newMethodDeclaration(
                javadoc.toJavadoc(),
                new AttributeBuilder(factory)
                    .annotation(util.t(OperatorInfo.class),
                            "kind", factory.newClassLiteral(util.t(descriptor.getAnnotationType())),
                            "input", factory.newArrayInitializer(inputMetaData),
                            "output", factory.newArrayInitializer(outputMetaData),
                            "parameter", factory.newArrayInitializer(parameterMetaData))
View Full Code Here

                        .text("Supports JDBC interfaces for ",
                                model.getName())
                        .linkType(context.resolve(model.getSymbol()))
                        .text(".")
                        .toJavadoc(),
                    new AttributeBuilder(f)
                        .Public()
                        .Final()
                        .toAttributes(),
                    context.getTypeName(),
                    Collections.<TypeParameterDeclaration>emptyList(),
View Full Code Here

        private List<TypeBodyDeclaration> createMetaData() {
            List<TypeBodyDeclaration> results = Lists.create();
            results.add(f.newFieldDeclaration(
                    null,
                    new AttributeBuilder(f)
                        .Private()
                        .Static()
                        .Final()
                        .toAttributes(),
                    f.newParameterizedType(
                            context.resolve(Map.class),
                            context.resolve(String.class),
                            context.resolve(Integer.class)),
                    f.newSimpleName(NAME_PROPERTY_POSITIONS),
                    null));
            List<Statement> statements = Lists.create();
            SimpleName map = f.newSimpleName("map");
            statements.add(new TypeBuilder(f, context.resolve(TreeMap.class))
                .parameterize(context.resolve(String.class), context.resolve(Integer.class))
                .newObject()
                .toLocalVariableDeclaration(
                        f.newParameterizedType(
                                context.resolve(Map.class),
                                context.resolve(String.class),
                                context.resolve(Integer.class)),
                        map));

            List<PropertyDeclaration> properties = getProperties();
            for (int i = 0, n = properties.size(); i < n; i++) {
                PropertyDeclaration property = properties.get(i);
                JdbcColumnTrait trait = property.getTrait(JdbcColumnTrait.class);
                assert trait != null;
                statements.add(new ExpressionBuilder(f, map)
                    .method("put", Models.toLiteral(f, trait.getName()), Models.toLiteral(f, i))
                    .toStatement());
            }
            statements.add(new ExpressionBuilder(f, f.newSimpleName(NAME_PROPERTY_POSITIONS))
                .assignFrom(map)
                .toStatement());
            results.add(f.newInitializerDeclaration(
                    null,
                    new AttributeBuilder(f)
                        .Static()
                        .toAttributes(),
                    f.newBlock(statements)));
            return results;
        }
View Full Code Here

        }

        private MethodDeclaration createGetSupportedType() {
            MethodDeclaration decl = f.newMethodDeclaration(
                    null,
                    new AttributeBuilder(f)
                        .annotation(context.resolve(Override.class))
                        .Public()
                        .toAttributes(),
                    f.newParameterizedType(
                            context.resolve(Class.class),
View Full Code Here

                            f.newBlock(new ExpressionBuilder(f, Models.toLiteral(f, false))
                                .toReturnStatement()))),
                    null));
            MethodDeclaration decl = f.newMethodDeclaration(
                    null,
                    new AttributeBuilder(f)
                        .annotation(context.resolve(Override.class))
                        .Public()
                        .toAttributes(),
                    context.resolve(boolean.class),
                    f.newSimpleName("isSupported"),
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.