Package com.asakusafw.utils.java.model.syntax

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory


    public List<Annotation> getTypeAnnotations(EmitContext context, ModelDeclaration model) {
        PrimaryKeyTrait trait = model.getTrait(PrimaryKeyTrait.class);
        if (trait == null) {
            return Collections.emptyList();
        }
        ModelFactory f = context.getModelFactory();
        List<Expression> properties = Lists.create();
        for (PropertySymbol property : trait.getProperties()) {
            String name = context.getFieldName(property.findDeclaration()).getToken();
            properties.add(Models.toLiteral(f, name));
        }
        return new AttributeBuilder(f)
            .annotation(context.resolve(PrimaryKey.class),
                    "value", f.newArrayInitializer(properties))
            .toAnnotations();
    }
View Full Code Here


        int total = models.size();
        LOG.info("{}個のモデルを出力しています: {}",
                total,
                configuration.getOutput());

        ModelFactory factory = Models.getModelFactory();
        AnyModelEntityEmitter modelEmitter = new AnyModelEntityEmitter(
                factory,
                configuration.getOutput(),
                configuration.getBasePackage(),
                configuration.getHeaderComments());
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.java.model.syntax.ModelFactory

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.