io.micronaut.context.env.Environment.getPlaceholderResolver()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中io.micronaut.context.env.Environment.getPlaceholderResolver()方法的一些代码示例,展示了Environment.getPlaceholderResolver()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getPlaceholderResolver()方法的具体详情如下:
包路径:io.micronaut.context.env.Environment
类名称:Environment
方法名:getPlaceholderResolver

Environment.getPlaceholderResolver介绍

暂无

代码示例

代码示例来源:origin: io.micronaut/inject

@SuppressWarnings("unchecked")
@Override
public Collection<V> values() {
  return super.values().stream().map(v -> {
    if (v instanceof CharSequence) {
      v = (V) environment.getPlaceholderResolver().resolveRequiredPlaceholders(v.toString());
    }
    return v;
  }).collect(Collectors.toList());
}

代码示例来源:origin: micronaut-projects/micronaut-spring

@Override
public String resolvePlaceholders(@Nonnull String text) {
  return environment.getPlaceholderResolver().resolvePlaceholders(text).orElse(text);
}

代码示例来源:origin: micronaut-projects/micronaut-spring

@Override
public String resolveRequiredPlaceholders(@Nonnull String text) throws IllegalArgumentException {
  return environment.getPlaceholderResolver().resolveRequiredPlaceholders(text);
}

代码示例来源:origin: io.micronaut/micronaut-inject

@SuppressWarnings("unchecked")
@Override
public Collection<V> values() {
  return super.values().stream().map(v -> {
    if (v instanceof CharSequence) {
      v = (V) environment.getPlaceholderResolver().resolveRequiredPlaceholders(v.toString());
    }
    return v;
  }).collect(Collectors.toList());
}

代码示例来源:origin: io.micronaut/inject

@Override
public Optional<String> resolvePlaceholders(String str) {
  return getEnvironment().getPlaceholderResolver().resolvePlaceholders(str);
}

代码示例来源:origin: io.micronaut/inject

@Override
public String resolveRequiredPlaceholders(String str) throws ConfigurationException {
  return getEnvironment().getPlaceholderResolver().resolveRequiredPlaceholders(str);
}

代码示例来源:origin: io.micronaut/micronaut-inject

@Override
public Optional<String> resolvePlaceholders(String str) {
  return getEnvironment().getPlaceholderResolver().resolvePlaceholders(str);
}

代码示例来源:origin: io.micronaut/micronaut-inject

@Override
public String resolveRequiredPlaceholders(String str) throws ConfigurationException {
  return getEnvironment().getPlaceholderResolver().resolveRequiredPlaceholders(str);
}

代码示例来源:origin: io.micronaut/micronaut-inject

@SuppressWarnings("unchecked")
private static Map<CharSequence, ?> resolveValues(Environment environment, Map<CharSequence, ?> values) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  return values.entrySet().stream().map((Function<Map.Entry<CharSequence, ?>, Map.Entry<CharSequence, ?>>) entry -> {
    Object value = entry.getValue();

代码示例来源:origin: io.micronaut/inject

@SuppressWarnings("unchecked")
private static Map<CharSequence, ?> resolveValues(Environment environment, Map<CharSequence, ?> values) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  return values.entrySet().stream().map((Function<Map.Entry<CharSequence, ?>, Map.Entry<CharSequence, ?>>) entry -> {
    Object value = entry.getValue();

代码示例来源:origin: io.micronaut/micronaut-inject

return environment.convert(acv.getType().orElse(acv.getName()), conversionContext);
} else if (value instanceof CharSequence) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  String str = doResolveIfNecessary((CharSequence) value, placeholderResolver);
  return environment.convert(str, conversionContext);
} else if (value instanceof String[]) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  String[] a = (String[]) value;
  String[] b = new String[a.length];

代码示例来源:origin: io.micronaut/inject

return environment.convert(acv.getType().orElse(acv.getName()), conversionContext);
} else if (value instanceof CharSequence) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  String str = doResolveIfNecessary((CharSequence) value, placeholderResolver);
  return environment.convert(str, conversionContext);
} else if (value instanceof String[]) {
  PropertyPlaceholderResolver placeholderResolver = environment.getPlaceholderResolver();
  String[] a = (String[]) value;
  String[] b = new String[a.length];

相关文章