本文整理了Java中restx.factory.Module
类的一些代码示例,展示了Module
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module
类的具体详情如下:
包路径:restx.factory.Module
类名称:Module
暂无
代码示例来源:origin: restx/restx
@Module(priority = 1000)
public class ClockModuleFactory {
@Provides
public Clock clock() {
return Clock.systemDefaultZone();
}
}
代码示例来源:origin: restx/restx
private void processProviderMethod(Module mod, ModuleClass module, Provides provides, ExecutableElement exec) {
ProviderMethod m = new ProviderMethod(
exec.getReturnType().toString(),
exec.getSimpleName().toString(),
provides.priority() == 0 ? mod.priority() : provides.priority(),
getInjectionName(exec.getAnnotation(Named.class)),
exec);
buildInjectableParams(exec, m.parameters);
buildCheckedExceptions(exec, m.exceptions);
module.providerMethods.add(m);
}
代码示例来源:origin: restx/restx
private void processConditionalProviderMethod(Module mod, ModuleClass module, String componentType,
String componentName, int priority, When when, String factoryMachineNameSuffix, ExecutableElement exec) {
ConditionalProviderMethod m = new ConditionalProviderMethod(
componentType,
componentName,
exec.getSimpleName().toString(),
priority == 0 ? mod.priority() : priority,
when.name(),
when.value(),
factoryMachineNameSuffix,
exec);
buildInjectableParams(exec, m.parameters);
buildCheckedExceptions(exec, m.exceptions);
module.conditionalProviderMethods.add(m);
}
代码示例来源:origin: restx/restx
@Module
public class StatsAdminModule {
@Provides
@Named("Stats")
public AdminPage getStatsAdminPage() {
return new AdminPage("/@/ui/stats/", "Stats");
}
@Provides @Named("StatsUIRoute")
public ResourcesRoute getStatsResourcesRoute() {
return new ResourcesRoute("StatsUIRoute", "/@/ui/stats", "restx/stats/ui", ImmutableMap.of("", "index.html"));
}
}
代码示例来源:origin: restx/restx
When classWhen = typeElem.getAnnotation(When.class);
ModuleClass module = new ModuleClass(typeElem.getQualifiedName().toString(), typeElem, mod.priority());
for (Element element : typeElem.getEnclosedElements()) {
exec.getReturnType().toString(),
getInjectionName(exec.getAnnotation(Named.class)).or(exec.getSimpleName().toString()),
provides.priority() == 0 ? mod.priority() : provides.priority(),
whenToUse,
"Conditional",
代码示例来源:origin: restx/restx
/**
* User: xavierhanin
* Date: 4/7/13
* Time: 2:59 PM
*/
@Module
public class FactoryAdminModule {
@Provides @Named("Factory")
public AdminPage getFactoryAdminPage() {
return new AdminPage("/@/ui/factory/", "Factory");
}
}
代码示例来源:origin: restx/restx
/**
*/
@Module
public class SpecModule {
@Provides
public ConfigSupplier specConfigSupplier(ConfigLoader configLoader) {
return configLoader.fromResource("restx/specs/specConfig");
}
}
代码示例来源:origin: restx/restx
/**
* @author fcamblor
*/
@Module(priority = 1000)
public class SimpleServerModule {
@Provides
@Named("restx.server.simple")
public WebServerSupplier simpleWebServerSupplier(){
return SimpleWebServer.simpleWebServerSupplier();
}
}
代码示例来源:origin: restx/restx
@Module(priority = 100)
public class HttpModule {
@Provides @Named("CurrentLocaleResolver")
public CurrentLocaleResolver currentLocaleResolver(){
return new RequestBasedLocaleResolver();
}
}
代码示例来源:origin: restx/restx
@Module
public class FrontObjectMapperJSR310ModuleFactory {
@Provides
public com.fasterxml.jackson.databind.Module jsr310Module() {
return new JSR310Module();
}
}
代码示例来源:origin: restx/restx
/**
* User: xavierhanin
* Date: 4/7/13
* Time: 2:59 PM
*/
@Module
public class ErrorsAdminModule {
@Provides @Named("Errors")
public AdminPage getErrorAdminPage() {
return new AdminPage("/@/ui/errors/", "Errors");
}
}
代码示例来源:origin: restx/restx
/**
*/
@Module
public class ConfigAdminModule {
@Provides @Named("Config")
public AdminPage getErrorAdminPage() {
return new AdminPage("/@/ui/config/", "Config");
}
}
代码示例来源:origin: restx/restx
/**
*/
@Module
public class MessagesAdminModule {
@Provides @Named("Messages")
public AdminPage getMessagesAdminPage() {
return new AdminPage("/@/ui/messages/", "Messages");
}
}
代码示例来源:origin: io.restx/restx-core-java8
@Module(priority = 1000)
public class ClockModuleFactory {
@Provides
public Clock clock() {
return Clock.systemDefaultZone();
}
}
代码示例来源:origin: io.restx/restx-core
@Module(priority = 100)
public class HttpModule {
@Provides @Named("CurrentLocaleResolver")
public CurrentLocaleResolver currentLocaleResolver(){
return new RequestBasedLocaleResolver();
}
}
代码示例来源:origin: io.restx/restx-server-simple
/**
* @author fcamblor
*/
@Module(priority = 1000)
public class SimpleServerModule {
@Provides
@Named("restx.server.simple")
public WebServerSupplier simpleWebServerSupplier(){
return SimpleWebServer.simpleWebServerSupplier();
}
}
代码示例来源:origin: io.restx/restx-core-java8
@Module
public class FrontObjectMapperJSR310ModuleFactory {
@Provides
public com.fasterxml.jackson.databind.Module jsr310Module() {
return new JSR310Module();
}
}
代码示例来源:origin: io.restx/restx-i18n-admin
/**
*/
@Module
public class MessagesAdminModule {
@Provides @Named("Messages")
public AdminPage getMessagesAdminPage() {
return new AdminPage("/@/ui/messages/", "Messages");
}
}
代码示例来源:origin: restx/restx
/**
* User: xavierhanin
* Date: 4/7/13
* Time: 2:59 PM
*/
@Module
public class MonitorAdminModule {
@Provides
@Named("Monitor")
public AdminPage getMonitorAdminPage() {
return new AdminPage("/@/ui/monitor/", "Monitor");
}
}
代码示例来源:origin: io.restx/restx-core
/**
*/
@Module
public class SpecModule {
@Provides
public ConfigSupplier specConfigSupplier(ConfigLoader configLoader) {
return configLoader.fromResource("restx/specs/specConfig");
}
}
内容来源于网络,如有侵权,请联系作者删除!