本文整理汇总了Java中org.codehaus.groovy.control.customizers.ImportCustomizer.addImports方法的典型用法代码示例。如果您正苦于以下问题:Java ImportCustomizer.addImports方法的具体用法?Java ImportCustomizer.addImports怎么用?Java ImportCustomizer.addImports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.groovy.control.customizers.ImportCustomizer
的用法示例。
在下文中一共展示了ImportCustomizer.addImports方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyImports
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) {
imports.addImports("org.springframework.batch.repeat.RepeatStatus",
"org.springframework.batch.core.scope.context.ChunkContext",
"org.springframework.batch.core.step.tasklet.Tasklet",
"org.springframework.batch.core.configuration.annotation.StepScope",
"org.springframework.batch.core.configuration.annotation.JobBuilderFactory",
"org.springframework.batch.core.configuration.annotation.StepBuilderFactory",
"org.springframework.batch.core.configuration.annotation.EnableBatchProcessing",
"org.springframework.batch.core.Step",
"org.springframework.batch.core.StepExecution",
"org.springframework.batch.core.StepContribution",
"org.springframework.batch.core.Job",
"org.springframework.batch.core.JobExecution",
"org.springframework.batch.core.JobParameter",
"org.springframework.batch.core.JobParameters",
"org.springframework.batch.core.launch.JobLauncher",
"org.springframework.batch.core.converter.JobParametersConverter",
"org.springframework.batch.core.converter.DefaultJobParametersConverter");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:21,代码来源:SpringBatchCompilerAutoConfiguration.java
示例2: addImport
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
private void addImport(final ImportCustomizer customizer, final Object value) {
if (value==null) return;
if (value instanceof Collection) {
for (Object e : (Collection)value) {
addImport(customizer, e);
}
} else if (value instanceof String) {
customizer.addImports((String)value);
} else if (value instanceof Class) {
customizer.addImports(((Class) value).getName());
} else if (value instanceof GString) {
customizer.addImports(value.toString());
} else {
throw new RuntimeException("Unsupported import value type ["+value+"]");
}
}
示例3: createImportCustomizer
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
private static ImportCustomizer createImportCustomizer() {
ImportCustomizer importCustomizer = new ImportCustomizer();
importCustomizer.addImports(ResourceHandler.class.getCanonicalName());
importCustomizer.addImports(SubjectHandler.class.getCanonicalName());
importCustomizer.addImports(AbstractHandler.class.getCanonicalName());
return importCustomizer;
}
示例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) {
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
示例6: 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
示例7: 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
示例8: 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);
}
}
}
示例9: 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);
}
示例10: applyImports
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addImports("org.springframework.cloud.netflix.ribbon.RibbonClient",
"org.springframework.cloud.client.loadbalancer.LoadBalancerClient",
"org.springframework.web.client.RestTemplate",
"com.netflix.client.config.DefaultClientConfigImpl",
"com.netflix.client.config.IClientConfig",
"com.netflix.loadbalancer.DynamicServerListLoadBalancer",
"com.netflix.loadbalancer.ILoadBalancer",
"com.netflix.loadbalancer.Server", "com.netflix.loadbalancer.ServerList",
"com.netflix.loadbalancer.ServerListFilter",
"com.netflix.niws.client.http.RestClient");
}
示例11: 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");
}
示例12: applyImports
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addImports(
"org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker",
"com.netflix.hystrix.contrib.javanica.annotation.HystrixCollapser",
"com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand");
}
示例13: applyImports
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addImports(
"org.springframework.cloud.client.discovery.EnableDiscoveryClient",
"org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean",
"org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"org.springframework.cloud.client.discovery.DiscoveryClient",
"org.springframework.cloud.client.ServiceInstance");
}
示例14: applyImports
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
@Override
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
imports.addImports("org.springframework.cloud.netflix.eureka.server.EnableEurekaServer",
"org.springframework.cloud.client.discovery.EnableDiscoveryClient",
"org.springframework.cloud.netflix.eureka.server.EurekaServerConfigBean",
"org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean",
"org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
"com.netflix.discovery.DiscoveryClient",
"com.netflix.appinfo.InstanceInfo");
}
示例15: addImportPathToImportCustomizer
import org.codehaus.groovy.control.customizers.ImportCustomizer; //导入方法依赖的package包/类
public static void addImportPathToImportCustomizer(ImportCustomizer icz, ImportPath importLine) {
if (importLine.asString().startsWith(STATIC_WORD_WITH_SPACE)) {
String pureImport = importLine.asString()
.replace(STATIC_WORD_WITH_SPACE, StringUtils.EMPTY)
.replace(DOT_STAR_POSTFIX, StringUtils.EMPTY);
if (importLine.asString().endsWith(DOT_STAR_POSTFIX)) {
icz.addStaticStars(pureImport);
} else {
int index = pureImport.lastIndexOf('.');
if (index == -1) {
return;
}
icz.addStaticImport(pureImport.substring(0, index), pureImport.substring(index + 1));
}
} else {
if (importLine.asString().endsWith(DOT_STAR_POSTFIX)) {
icz.addStarImports(importLine.asString().replace(DOT_STAR_POSTFIX, StringUtils.EMPTY));
} else {
icz.addImports(importLine.asString());
}
}
}