All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dz.jtsgen.processor.renderer.TSRenderer Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
package dz.jtsgen.processor.renderer;

import dz.jtsgen.processor.model.TypeScriptModel;
import dz.jtsgen.processor.nsmap.NameSpaceMapperFactory;
import dz.jtsgen.processor.nsmap.NameSpaceModelMapper;
import dz.jtsgen.processor.renderer.model.TypeScriptRenderModel;
import dz.jtsgen.processor.renderer.module.ModuleGenerator;

import javax.annotation.processing.ProcessingEnvironment;
import java.util.logging.Logger;


public final class TSRenderer {

    private static Logger LOG = Logger.getLogger(TSRenderer.class.getName());

    private final TypeScriptModel model;
    private final NameSpaceModelMapper nameSpaceModelMapper;
    private final ProcessingEnvironment env;

    public TSRenderer(ProcessingEnvironment env, TypeScriptModel model) {
        this.env=env;
        this.model=model;
        this.nameSpaceModelMapper = NameSpaceMapperFactory.createNameSpaceMapper(model.getModuleInfo());
    }


    public void writeFiles() {
        LOG.finest("-- Name Space Mapper --");
        TypeScriptRenderModel mappedModel = new TypeScriptRenderModel(nameSpaceModelMapper.mapNameSpacesOfModel(this.model));
        LOG.finest("-- Renderer --");
        new ModuleGenerator(mappedModel, env).writeModule();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy