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


Java ImportCustomizer.addStarImports方法代码示例

本文整理汇总了Java中org.codehaus.groovy.control.customizers.ImportCustomizer.addStarImports方法的典型用法代码示例。如果您正苦于以下问题:Java ImportCustomizer.addStarImports方法的具体用法?Java ImportCustomizer.addStarImports怎么用?Java ImportCustomizer.addStarImports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.groovy.control.customizers.ImportCustomizer的用法示例。


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

示例1: getGroovyShell

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
private GroovyShell getGroovyShell() {
  if (this.groovySh == null) {
    // add some default imports to the script
    ImportCustomizer defaultImports = new ImportCustomizer();
    defaultImports
        .addStarImports("fr.ign.cogit.geoxygene.appli.render.primitive");
    defaultImports
        .addStarImports("fr.ign.cogit.geoxygene.appli.render.operator");
    defaultImports.addStarImports("fr.ign.cogit.geoxygene.appli.render.gl");
    defaultImports.addStarImports("fr.ign.cogit.geoxygene.appli.render");
    defaultImports.addStarImports("fr.ign.cogit.geoxygene.function");
    defaultImports.addStaticStars("org.lwjgl.opengl.GL11");
    defaultImports.addStaticStars("java.lang.Math");
    defaultImports.addStarImports("javax.vecmath");
    defaultImports.addStarImports("java.awt");
    final CompilerConfiguration config = new CompilerConfiguration();
    config.addCompilationCustomizers(defaultImports);
    final Binding binding = this.getBinding();

    this.groovySh = new GroovyShell(binding, config);
  }
  return this.groovySh;
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:24,代码来源:ScriptingPrimitiveRenderer.java

示例2: init

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@PostConstruct
public void init() {
    ImportCustomizer importCustomizer = new ImportCustomizer();
    importCustomizer.addStarImports("net.dv8tion.jda.core.entities");

    configuration = new CompilerConfiguration();
    configuration.addCompilationCustomizers(importCustomizer);

    sharedData = new Binding();
    sharedData.setProperty("ctx", context);
    sharedData.setProperty("jda", discordService.getJda());
}
 
开发者ID:GoldRenard,项目名称:JuniperBotJ,代码行数:13,代码来源:GroovyService.java

示例3: ConfigManager

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
private ConfigManager()
{
    CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
    ImportCustomizer importCustomizer = new ImportCustomizer();
    importCustomizer.addStarImports("org.diorite.config", "org.diorite.config.serialization", "org.diorite", "org.diorite.config.exceptions");
    compilerConfiguration.addCompilationCustomizers(importCustomizer);
    GroovyClassLoader groovyClassLoader = new GroovyClassLoader(this.getClass().getClassLoader(), compilerConfiguration);
    this.groovy = new GroovyScriptEngineImpl(groovyClassLoader);
    DynamicClassLoader classLoader = DynamicClassLoader.injectAsSystemClassLoader();
    classLoader.addClassLoader(groovyClassLoader, 0);
    this.setImplementationProvider(GroovyImplementationProvider.getInstance());
}
 
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:13,代码来源:ConfigManager.java

示例4: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) {
	imports.addImports("javax.annotation.PostConstruct",
			"javax.annotation.PreDestroy", "groovy.util.logging.Log",
			"org.springframework.stereotype.Controller",
			"org.springframework.stereotype.Service",
			"org.springframework.stereotype.Component",
			"org.springframework.beans.factory.annotation.Autowired",
			"org.springframework.beans.factory.annotation.Value",
			"org.springframework.context.annotation.Import",
			"org.springframework.context.annotation.ImportResource",
			"org.springframework.context.annotation.Profile",
			"org.springframework.context.annotation.Scope",
			"org.springframework.context.annotation.Configuration",
			"org.springframework.context.annotation.ComponentScan",
			"org.springframework.context.annotation.Bean",
			"org.springframework.context.ApplicationContext",
			"org.springframework.context.MessageSource",
			"org.springframework.core.annotation.Order",
			"org.springframework.core.io.ResourceLoader",
			"org.springframework.boot.ApplicationRunner",
			"org.springframework.boot.ApplicationArguments",
			"org.springframework.boot.CommandLineRunner",
			"org.springframework.boot.context.properties.ConfigurationProperties",
			"org.springframework.boot.context.properties.EnableConfigurationProperties",
			"org.springframework.boot.autoconfigure.EnableAutoConfiguration",
			"org.springframework.boot.context.properties.ConfigurationProperties",
			"org.springframework.boot.context.properties.EnableConfigurationProperties");
	imports.addStarImports("org.springframework.stereotype",
			"org.springframework.scheduling.annotation");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:32,代码来源:SpringBootCompilerAutoConfiguration.java

示例5: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
	imports.addStarImports("org.springframework.amqp.rabbit.annotation",
			"org.springframework.amqp.rabbit.core",
			"org.springframework.amqp.rabbit.config",
			"org.springframework.amqp.rabbit.connection",
			"org.springframework.amqp.rabbit.listener",
			"org.springframework.amqp.rabbit.listener.adapter",
			"org.springframework.amqp.core");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:RabbitCompilerAutoConfiguration.java

示例6: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) {
	imports.addImports("org.springframework.messaging.Message",
			"org.springframework.messaging.MessageChannel",
			"org.springframework.messaging.PollableChannel",
			"org.springframework.messaging.SubscribableChannel",
			"org.springframework.messaging.MessageHeaders",
			"org.springframework.integration.support.MessageBuilder",
			"org.springframework.integration.channel.DirectChannel",
			"org.springframework.integration.channel.QueueChannel",
			"org.springframework.integration.channel.ExecutorChannel",
			"org.springframework.integration.core.MessagingTemplate",
			"org.springframework.integration.config.EnableIntegration");
	imports.addStarImports("org.springframework.integration.annotation");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:SpringIntegrationCompilerAutoConfiguration.java

示例7: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) {
	imports.addStarImports("org.springframework.web.bind.annotation",
			"org.springframework.web.servlet.config.annotation",
			"org.springframework.web.servlet", "org.springframework.http",
			"org.springframework.web.servlet.handler", "org.springframework.http",
			"org.springframework.ui", "groovy.text");
	imports.addStaticImport(GroovyTemplate.class.getName(), "template");
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:10,代码来源:SpringMvcCompilerAutoConfiguration.java

示例8: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
	imports.addStarImports("javax.jms", "org.springframework.jms.annotation",
			"org.springframework.jms.config", "org.springframework.jms.core",
			"org.springframework.jms.listener",
			"org.springframework.jms.listener.adapter");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:JmsCompilerAutoConfiguration.java

示例9: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) {
	imports.addStarImports("org.springframework.transaction.annotation",
			"org.springframework.transaction.support");
	imports.addImports("org.springframework.transaction.PlatformTransactionManager",
			"org.springframework.transaction.support.AbstractPlatformTransactionManager");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:TransactionManagementCompilerAutoConfiguration.java

示例10: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
	imports.addImports(
			"org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso");
	imports.addStarImports(
			"org.springframework.security.oauth2.config.annotation.web.configuration",
			"org.springframework.security.access.prepost");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:SpringSecurityOAuth2CompilerAutoConfiguration.java

示例11: processImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
protected static void processImports(final ImportCustomizer ic, final Set<String> imports) {
    for (final String imp : imports) {
        if (imp.endsWith(DOT_STAR)) {
            ic.addStarImports(imp.replace(DOT_STAR, EMPTY_STRING));
        } else {
            ic.addImports(imp);
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:10,代码来源:AbstractImportCustomizerProvider.java

示例12: GroovyCodeBlockCompiler

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
private GroovyCodeBlockCompiler() {

        CompilerConfiguration conf = new CompilerConfiguration(CompilerConfiguration.DEFAULT);

        ImportCustomizer imports = new ImportCustomizer();
        imports.addStarImports("org.voltdb");
        imports.addImports(
                "org.voltdb.groovy.TableBuilder",
                "org.voltdb.groovy.Tuplerator",
                "org.voltdb.VoltProcedure.VoltAbortException"
                 );
        imports.addStaticStars("org.voltdb.VoltProcedure","org.voltdb.VoltType");

        conf.addCompilationCustomizers(imports);
        // conf.getOptimizationOptions().put("int", false);
        // conf.getOptimizationOptions().put("indy", true);
        conf.setScriptBaseClass(DelegatingScript.class.getName());

        File groovyOut = createGroovyOutDirectory();

        List<String> classPath = conf.getClasspath();
        classPath.add(groovyOut.getAbsolutePath());
        conf.setClasspathList(classPath);

        conf.setTargetDirectory(groovyOut);

        gcl = new GroovyClassLoader(Thread.currentThread().getContextClassLoader(), conf);
    }
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:29,代码来源:GroovyCodeBlockCompiler.java

示例13: getImportCustomizer

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
public static ImportCustomizer getImportCustomizer() {
    final ImportCustomizer ic = new DefaultImportCustomizerProvider().getImportCustomizer();
    for (final String imp : Imports.getImports()) {
        ic.addStarImports(imp.replace(DOT_STAR, EMPTY_STRING));
    }
    return ic;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:8,代码来源:FaunusGremlinScriptEngine.java

示例14: applyImports

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
	this.integration.applyImports(imports);
	imports.addImports("org.springframework.boot.groovy.cloud.EnableBinding");
	imports.addImport("IntegrationMessageSource",
			"org.springframework.integration.core.MessageSource");
	imports.addStarImports("org.springframework.cloud.stream.annotation",
			"org.springframework.cloud.stream.messaging");
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cli,代码行数:10,代码来源:BaseStreamCompilerAutoConfiguration.java

示例15: getCompilerConfiguration

import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
/**
 * Get default compiler configuration for {@link GroovyShell}.
 */
public CompilerConfiguration getCompilerConfiguration() {
    CompilerConfiguration cc = new CompilerConfiguration();
    ImportCustomizer imports = new ImportCustomizer();
    for (String starImport: STAR_IMPORTS) {
        imports.addStarImports(starImport);
    }
    for (String staticStar: STATIC_IMPORTS) {
        imports.addStaticStars(staticStar);
    }
    cc.addCompilationCustomizers(imports);
    return cc;
}
 
开发者ID:olivergondza,项目名称:dumpling,代码行数:16,代码来源:GroovyInterpretterConfig.java


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