Examples of ASTTransformationCustomizer


Examples of org.codehaus.groovy.control.customizers.ASTTransformationCustomizer

    public MarkupTemplateEngine(final ClassLoader parentLoader, final TemplateConfiguration tplConfig, final TemplateResolver resolver) {
        compilerConfiguration = new CompilerConfiguration();
        templateConfiguration = tplConfig;
        compilerConfiguration.addCompilationCustomizers(new TemplateASTTransformer(tplConfig));
        compilerConfiguration.addCompilationCustomizers(
                new ASTTransformationCustomizer(Collections.singletonMap("extensions", "groovy.text.markup.MarkupTemplateTypeCheckingExtension"), CompileStatic.class));
        if (templateConfiguration.isAutoNewLine()) {
            compilerConfiguration.addCompilationCustomizers(
                    new CompilationCustomizer(CompilePhase.CONVERSION) {
                        @Override
                        public void call(final SourceUnit source, final GeneratorContext context, final ClassNode classNode) throws CompilationFailedException {
View Full Code Here

Examples of org.codehaus.groovy.control.customizers.ASTTransformationCustomizer

   * @param <T> The expected type of the return value
   * @return The return value of the script, not null
   */
  private static <T> T runGroovyDslScript(Reader scriptReader, Class<T> expectedType, Map<String, Object> parameters) {
    Map<String, Object> timeoutArgs = ImmutableMap.<String, Object>of("value", 2);
    ASTTransformationCustomizer customizer = new ASTTransformationCustomizer(timeoutArgs, TimedInterrupt.class);
    CompilerConfiguration config = new CompilerConfiguration();
    config.addCompilationCustomizers(customizer);
    config.setScriptBaseClass(SimulationScript.class.getName());
    Binding binding = new Binding(parameters);
    GroovyShell shell = new GroovyShell(binding, config);
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.