Package org.eclipse.xpand2

Examples of org.eclipse.xpand2.Generator


    with(new XdocStandaloneSetup());
    getInjector().injectMembers(this);
    this.pTest = new ParserTest();
    this.pTest.setUp();

    Output output = new OutputImpl();
    Outlet outlet = new Outlet(RESULT_DIR);
    output.addOutlet(outlet);

    ResourceLoaderFactory.setCurrentThreadResourceLoader(new ResourceLoaderImpl(getClass().getClassLoader()));
    xpandCtx = new XpandExecutionContextImpl(output, null);
    Map<String, Variable> variables = xpandCtx.getGlobalVariables();
    Variable srcDir = new Variable("srcDir", SRC_DIR);
View Full Code Here


  private void generate(TranslationUnit model) {
    // http://www.peterfriese.de/using-xpand-in-your-eclipse-wizards/

    // Configure outlets
    OutputImpl output = new OutputImpl();
    Outlet outlet = new Outlet("model");
    outlet.setOverwrite(true);
    // outlet.addPostprocessor(new CppBeautifier());
    outlet.setPath(targetDir);
    output.addOutlet(outlet);

    // Protected regions
    ProtectedRegionResolverImpl pr = new ProtectedRegionResolverImpl();
    pr.setSrcPathes(prSrcPaths);
    pr.setDefaultExcludes(true);
View Full Code Here

    with(new XdocStandaloneSetup());
    getInjector().injectMembers(this);
    this.pTest = new ParserTest();
    this.pTest.setUp();

    Output output = new OutputImpl();
    Outlet outlet = new Outlet(RESULT_DIR);
    output.addOutlet(outlet);

    ResourceLoaderFactory.setCurrentThreadResourceLoader(new ResourceLoaderImpl(getClass().getClassLoader()));
    xpandCtx = new XpandExecutionContextImpl(output, null);
    Map<String, Variable> variables = xpandCtx.getGlobalVariables();
    Variable srcDir = new Variable("srcDir", SRC_DIR);
View Full Code Here

      beautifier.setStrict(true);

    }

    public void testSample0() throws Exception {
        PostProcessor postProcessor = new JavaImportBeautifier();
        Properties p = System.getProperties();
        File file = new File("src/test/resources/Sample0.java");
        FileHandle fh = new FileHandleImpl(null, file);

        fh.setBuffer(new CharacterSequence(loadTestFile("Sample01.java_input")));

        postProcessor.beforeWriteAndClose(fh);

        assertNotNull(fh.getBuffer());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.xpand2.Generator

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.