本文整理了Java中io.micronaut.context.ApplicationContext.getProperty()
方法的一些代码示例,展示了ApplicationContext.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext.getProperty()
方法的具体详情如下:
包路径:io.micronaut.context.ApplicationContext
类名称:ApplicationContext
方法名:getProperty
暂无
代码示例来源:origin: micronaut-projects/micronaut-spring
@Override
public String getApplicationName() {
return micronautContext.getProperty("micronaut.application.name", String.class).orElse(io.micronaut.context.env.Environment.DEFAULT_NAME);
}
代码示例来源:origin: io.micronaut/micronaut-inject
private Optional resolveValue(
ApplicationContext context,
ArgumentConversionContext<?> argument,
boolean hasValueAnnotation,
String valString) {
if (hasValueAnnotation) {
return context.resolvePlaceholders(valString).flatMap(v ->
context.getConversionService().convert(v, argument)
);
} else {
Optional<?> value = context.getProperty(valString, argument);
if (!value.isPresent() && isConfigurationProperties()) {
String cliOption = resolveCliOption(argument.getArgument().getName());
if (cliOption != null) {
return context.getProperty(cliOption, argument);
}
}
return value;
}
}
代码示例来源:origin: io.micronaut/inject
private Optional resolveValue(
ApplicationContext context,
ArgumentConversionContext<?> argument,
boolean hasValueAnnotation,
String valString) {
if (hasValueAnnotation) {
return context.resolvePlaceholders(valString).flatMap(v ->
context.getConversionService().convert(v, argument)
);
} else {
Optional<?> value = context.getProperty(valString, argument);
if (!value.isPresent() && isConfigurationProperties()) {
String cliOption = resolveCliOption(argument.getArgument().getName());
if (cliOption != null) {
return context.getProperty(cliOption, argument);
}
}
return value;
}
}
内容来源于网络,如有侵权,请联系作者删除!