gpt4 book ai didi

com.stormpath.sdk.impl.config.YAMLPropertiesSource类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 03:37:31 25 4
gpt4 key购买 nike

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

YAMLPropertiesSource介绍

暂无

代码示例

代码示例来源:origin: stormpath/stormpath-sdk-java

/**
 * Return a flattened version of the given map, recursively following any nested Map
 * or Collection values. Entries from the resulting map retain the same order as the
 * source.
 *
 * Copied from https://github.com/spring-projects/spring-framework/blob/master/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java
 *
 * @param source the source map
 * @return a flattened map
 * @since 1.0
 */
protected final Map<String, String> getFlattenedMap(Map<String, Object> source) {
  Map<String, String> result = new LinkedHashMap<>();
  buildFlattenedMap(result, source, null);
  return result;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
@SuppressWarnings("unchecked")
public Map<String, String> getProperties() {
  try (InputStream in = resource.getInputStream()) {
    // check to see if file exists
    if (in != null) { // only check if class is available, if we have a yaml file.
      if (Classes.isAvailable("org.yaml.snakeyaml.Yaml")) {
        Yaml yaml = new Yaml();
        Map config = yaml.loadAs(in, Map.class);
        return getFlattenedMap(config);
      } else {
        log.warn("YAML not found in classpath, add 'org.yaml.snakeyaml' to support YAML configuration");
      }
    }
  } catch (IOException e) {
    throw new IllegalArgumentException("Unable to read resource [" + resource + "]: " + e.getMessage(), e);
  }
  return new LinkedHashMap<>();
}

代码示例来源:origin: stormpath/stormpath-sdk-java

PropertiesSource yamlSource = new OptionalPropertiesSource(new YAMLPropertiesSource(resource));
sources.add(yamlSource);

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-impl

PropertiesSource yamlSource = new OptionalPropertiesSource(new YAMLPropertiesSource(resource));
sources.add(yamlSource);

代码示例来源:origin: stormpath/stormpath-sdk-java

propertiesSource = new YAMLPropertiesSource(resource);
if (!required) {
  propertiesSource = new OptionalPropertiesSource(propertiesSource);
propertiesSource = new YAMLPropertiesSource(resource);
if (!required) {
  propertiesSource = new OptionalPropertiesSource(propertiesSource);

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-impl

/**
 * Return a flattened version of the given map, recursively following any nested Map
 * or Collection values. Entries from the resulting map retain the same order as the
 * source.
 *
 * Copied from https://github.com/spring-projects/spring-framework/blob/master/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java
 *
 * @param source the source map
 * @return a flattened map
 * @since 1.0
 */
protected final Map<String, String> getFlattenedMap(Map<String, Object> source) {
  Map<String, String> result = new LinkedHashMap<>();
  buildFlattenedMap(result, source, null);
  return result;
}

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-impl

@Override
@SuppressWarnings("unchecked")
public Map<String, String> getProperties() {
  try (InputStream in = resource.getInputStream()) {
    // check to see if file exists
    if (in != null) { // only check if class is available, if we have a yaml file.
      if (Classes.isAvailable("org.yaml.snakeyaml.Yaml")) {
        Yaml yaml = new Yaml();
        Map config = yaml.loadAs(in, Map.class);
        return getFlattenedMap(config);
      } else {
        log.warn("YAML not found in classpath, add 'org.yaml.snakeyaml' to support YAML configuration");
      }
    }
  } catch (IOException e) {
    throw new IllegalArgumentException("Unable to read resource [" + resource + "]: " + e.getMessage(), e);
  }
  return new LinkedHashMap<>();
}

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet

propertiesSource = new YAMLPropertiesSource(resource);
if (!required) {
  propertiesSource = new OptionalPropertiesSource(propertiesSource);
propertiesSource = new YAMLPropertiesSource(resource);
if (!required) {
  propertiesSource = new OptionalPropertiesSource(propertiesSource);

代码示例来源:origin: stormpath/stormpath-sdk-java

buildFlattenedMap(result, map, key);

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-impl

buildFlattenedMap(result, map, key);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com