Examples of DmdlSemantics


Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

        DmdlSourceResource repo = new DmdlSourceResource(Arrays.asList(resource), Charset.forName("UTF-8"));
        ClassLoader loader = ExcelTesterRoot.class.getClassLoader();
        AnalyzeTask task = new AnalyzeTask(testName.getMethodName(), loader);
        try {
            DmdlSemantics results = task.process(repo);
            ModelDeclaration decl = results.findModelDeclaration(model);
            assertThat(dmdl + ":" + model, decl, not(nullValue()));
            return decl;
        } catch (IOException e) {
            throw new AssertionError(e);
        }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

     * Generates all templates from source repository in the current configuration.
     * @throws IOException if failed to process DMDL scripts, or failed to generate templates
     */
    public void process() throws IOException {
        LOG.info("テンプレートの生成を開始しています");
        DmdlSemantics semantics = analyze();
        for (ModelDeclaration model : semantics.getDeclaredModels()) {
            LOG.info("テンプレートを生成しています: {}", model.getName().identifier);
            generator.generate(model);
        }
        LOG.info("テンプレートの生成を終了しました");
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

     */
    public void process(JavaDataModelDriver driver) throws IOException {
        if (driver == null) {
            throw new IllegalArgumentException("driver must not be null"); //$NON-NLS-1$
        }
        DmdlSemantics semantics = analyze();
        JavaModelClassGenerator generator = new JavaModelClassGenerator(semantics, conf, driver);
        Collection<ModelDeclaration> models = semantics.getDeclaredModels();
        LOG.info(Messages.getString("GenerateTask.monitorGenerateStarting"), models.size()); //$NON-NLS-1$
        for (ModelDeclaration model : models) {
            LOG.info(Messages.getString("GenerateTask.monitorGenerateModel"), model.getName()); //$NON-NLS-1$
            generator.emit(model);
        }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

        AstScript script = parse();
        DmdlAnalyzer result = new DmdlAnalyzer(typeDrivers, attributeDrivers);
        for (AstModelDefinition<?> model : script.models) {
            result.addModel(model);
        }
        DmdlSemantics resolved = result.resolve();
        return resolved;
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * simple record.
     */
    @Test
    public void simple() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));
        PropertyDeclaration property = simple.findPropertyDeclaration("a");
        assertThat(property, not(nullValue()));
        assertThat(property.getType(), is(type(BasicTypeKind.INT)));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * simple record with projections.
     */
    @Test
    public void projections() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration a = simple.findPropertyDeclaration("a");
        assertThat(a, not(nullValue()));
        assertThat(a.getType(), is(type(BasicTypeKind.INT)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * joined model.
     */
    @Test
    public void join() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration sid = simple.findPropertyDeclaration("sid");
        assertThat(sid, not(nullValue()));
        assertThat(sid.getType(), is(type(BasicTypeKind.LONG)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * summarized model.
     */
    @Test
    public void summarize() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration key = simple.findPropertyDeclaration("key");
        assertThat(key, not(nullValue()));
        assertThat(key.getType(), is(type(BasicTypeKind.INT)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * summarized model.
     */
    @Test
    public void summarize_whole() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration counter = resolved.findModelDeclaration("counter");
        assertThat(counter, not(nullValue()));

        PropertyDeclaration count = counter.findPropertyDeclaration("count");
        assertThat(count, not(nullValue()));
        assertThat(count.getType(), is(type(BasicTypeKind.LONG)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * simple namespace.
     */
    @Test
    public void namespace() {
        DmdlSemantics world = resolve();
        ModelDeclaration model = world.findModelDeclaration("simple");
        assertThat(model.getSymbol(), is(model("simple")));

        NamespaceTrait trait = model.getTrait(NamespaceTrait.class);
        assertThat(trait, not(nullValue()));
        assertThat(trait.getNamespace().toString(), is("com.example"));
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.