Package com.asakusafw.dmdl.source

Examples of com.asakusafw.dmdl.source.DmdlSourceRepository


        GenerateTask task;
        try {
            CommandLineParser parser = new BasicParser();
            CommandLine cmd = parser.parse(OPTIONS, args);
            TemplateGenerator generator = getGenerator(cmd);
            DmdlSourceRepository repository = getRepository(cmd);
            ClassLoader classLoader = getClassLoader(cmd);
            task = new GenerateTask(generator, repository, classLoader);
        } catch (Exception e) {
            HelpFormatter formatter = new HelpFormatter();
            formatter.setWidth(Integer.MAX_VALUE);
View Full Code Here


    private static DmdlSourceRepository getRepository(CommandLine cmd) {
        assert cmd != null;
        Charset encoding = parseCharset(cmd.getOptionValue(OPT_ENCODING.getOpt()));
        String sourceCmd = cmd.getOptionValue(OPT_SOURCE_PATH.getOpt());
        DmdlSourceRepository source = buildRepository(parseFileList(sourceCmd), encoding);
        return source;
    }
View Full Code Here

     * @throws Exception if occur
     */
    @Test
    public void process() throws Exception {
        Mock mock = new Mock();
        DmdlSourceRepository repo = repo("simple.dmdl");
        GenerateTask task = new GenerateTask(mock, repo, getClass().getClassLoader());
        task.process();
        assertThat(mock.saw.size(), is(4));
        assertThat(mock.saw, hasItem("p"));
        assertThat(mock.saw, hasItem("a"));
View Full Code Here

                if ((target instanceof DmdlSourceRepository) == false) {
                    return false;
                }
                Set<String> saw = new TreeSet<String>();
                try {
                    DmdlSourceRepository repo = (DmdlSourceRepository) target;
                    Cursor cursor = repo.createCursor();
                    try {
                        while (cursor.next()) {
                            String path = cursor.getIdentifier().getRawPath();
                            if (path.endsWith("/")) {
                                path = path.substring(0, path.length() - 1);
View Full Code Here

        Charset targetEnc = parseCharset(cmd.getOptionValue(OPT_TARGET_ENCODING.getOpt()));
        String sourcePaths = cmd.getOptionValue(OPT_SOURCE_PATH.getOpt());
        String plugin = cmd.getOptionValue(OPT_PLUGIN.getOpt());

        File outputDirectory = new File(output);
        DmdlSourceRepository source = buildRepository(parseFileList(sourcePaths), sourceEnc);
        ClassLoader serviceLoader = buildPluginLoader(Main.class.getClassLoader(), parseFileList(plugin));

        ModelFactory factory = Models.getModelFactory();
        return new Configuration(
                factory,
View Full Code Here

        return compiler.getClassLoader();
    }

    private List<VolatileJavaFile> emit(String name) {
        ModelFactory factory = Models.getModelFactory();
        DmdlSourceRepository source = collectInput(name);
        VolatileEmitter emitter = new VolatileEmitter();
        Configuration conf = new Configuration(
                factory,
                source,
                Models.toName(factory, "com.example"),
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.source.DmdlSourceRepository

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.