当前位置: 首页>>代码示例>>Java>>正文


Java CompileStatic类代码示例

本文整理汇总了Java中groovy.transform.CompileStatic的典型用法代码示例。如果您正苦于以下问题:Java CompileStatic类的具体用法?Java CompileStatic怎么用?Java CompileStatic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CompileStatic类属于groovy.transform包,在下文中一共展示了CompileStatic类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import groovy.transform.CompileStatic; //导入依赖的package包/类
@Override
public CompilationCustomizer create() {
    final Map<String, Object> annotationParams = new HashMap<>();
    if (extensions != null && !extensions.isEmpty()) {
        if (extensions.contains(","))
            annotationParams.put("extensions", Stream.of(extensions.split(",")).collect(Collectors.toList()));
        else
            annotationParams.put("extensions", Collections.singletonList(extensions));
    }

    return new ASTTransformationCustomizer(annotationParams, CompileStatic.class);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:13,代码来源:CompileStaticCustomizerProvider.java

示例2: createStaticConfiguration

import groovy.transform.CompileStatic; //导入依赖的package包/类
protected static CompilerConfiguration createStaticConfiguration() {
    CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
    ASTTransformationCustomizer astTransformationCustomizer = new ASTTransformationCustomizer(
            Collections.singletonMap("extensions", Collections.singletonList("EngineVariablesExtension.groovy")),
            CompileStatic.class, "org.codehaus.groovy.transform.sc.StaticCompileTransformation");
    compilerConfiguration.addCompilationCustomizers(astTransformationCustomizer);
    return compilerConfiguration;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:GroovyStaticScriptEngine.java

示例3: MarkupTemplateEngine

import groovy.transform.CompileStatic; //导入依赖的package包/类
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 {
                        new AutoNewLineTransformer(source).visitClass(classNode);
                    }
                }
        );
    }
    groovyClassLoader = AccessController.doPrivileged(new PrivilegedAction<TemplateGroovyClassLoader>() {
        public TemplateGroovyClassLoader run() {
            return new TemplateGroovyClassLoader(parentLoader, compilerConfiguration);
        }
    });
    if (DEBUG_BYTECODE) {
        compilerConfiguration.setBytecodePostprocessor(BytecodeDumper.STANDARD_ERR);
    }
    templateResolver = resolver == null ? new DefaultTemplateResolver() : resolver;
    templateResolver.configure(groovyClassLoader, templateConfiguration);
}
 
开发者ID:apache,项目名称:groovy,代码行数:28,代码来源:MarkupTemplateEngine.java

示例4: createASTTransformationCustomizer

import groovy.transform.CompileStatic; //导入依赖的package包/类
private ASTTransformationCustomizer createASTTransformationCustomizer() {

        return new ASTTransformationCustomizer(singletonMap("extensions",
                singletonList("com.ge.predix.acs.commons.policy.condition.groovy.GroovySecureExtension")),
                CompileStatic.class);
    }
 
开发者ID:eclipse,项目名称:keti,代码行数:7,代码来源:GroovyConditionShell.java


注:本文中的groovy.transform.CompileStatic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。