Package com.asakusafw.modelgen.model

Examples of com.asakusafw.modelgen.model.Source


        assert left.size() == right.size();

        StringBuilder joinCond = new StringBuilder();
        joinCond.append("<ul>");
        for (int i = 0, n = left.size(); i < n; i++) {
            Source a = left.get(i);
            Source b = right.get(i);
            joinCond.append(MessageFormat.format(
                    "<li><code>{0}.{1} == {2}.{3}</code></li>",
                    a.getDeclaring().getSimpleName(),
                    a.getName(),
                    b.getDeclaring().getSimpleName(),
                    b.getName()));
        }
        joinCond.append("</ul>");
        return new JavadocBuilder(f)
            .text("テーブル<code>{0}, {1}</code>を結合した結果のモデルクラス。",
                    model.getFromModel().getSimpleName(),
View Full Code Here


            .toJavadoc();
    }

    private String getColumnDescription(ModelProperty property) {
        if (property.getFrom() == null || property.getJoined() == null) {
            Source first = property.getSource();
            return MessageFormat.format(
                    "カラム<code>{0}.{1}</code>の内容",
                    first.getDeclaring().getSimpleName(),
                    first.getName());
        } else {
            Source first = property.getFrom();
            Source second = property.getJoined();
            return MessageFormat.format(
                    "カラム<code>{0}.{1}</code>および<code>{2}.{3}</code>の内容",
                    first.getDeclaring().getSimpleName(),
                    first.getName(),
                    second.getDeclaring().getSimpleName(),
                    second.getName());
        }
    }
View Full Code Here

        ModelProperty value = properties.get(0);
        assertThat(value.getName(), is("value"));
        assertThat(value.getType().getKind(), is(PropertyTypeKind.INT));
        assertThat(value.getJoined(), is(nullValue()));

        Source valueSrc = value.getFrom();
        assertThat(valueSrc.getAggregator(), is(Aggregator.IDENT));
        assertThat(valueSrc.getDeclaring(), is(desc.getReference()));
        assertThat(valueSrc.getName(), is("value"));
        assertThat(valueSrc.getType().getKind(), is(PropertyTypeKind.INT));
        assertThat(valueSrc.getAttributes().size(), is(0));
    }
View Full Code Here

    }

    private Source source(ModelDescription model, String name, Aggregator aggr) {
        for (Source s : model.getPropertiesAsSources()) {
            if (name.equals(s.getName())) {
                return new Source(
                        aggr,
                        s.getDeclaring(),
                        s.getName(),
                        s.getType(),
                        s.getAttributes());
View Full Code Here

TOP

Related Classes of com.asakusafw.modelgen.model.Source

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.