gpt4 book ai didi

com.fasterxml.jackson.dataformat.yaml.YAMLMapper.readerFor()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 08:18:40 26 4
gpt4 key购买 nike

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

YAMLMapper.readerFor介绍

暂无

代码示例

代码示例来源:origin: org.springframework.cloud/spring-cloud-skipper-server-core

protected List<PackageMetadata> deserializeFromIndexFiles(List<File> indexFiles) {
  List<PackageMetadata> packageMetadataList = new ArrayList<>();
  YAMLMapper yamlMapper = new YAMLMapper();
  yamlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  for (File indexFile : indexFiles) {
    try {
      MappingIterator<PackageMetadata> it = yamlMapper.readerFor(PackageMetadata.class).readValues(indexFile);
      while (it.hasNextValue()) {
        PackageMetadata packageMetadata = it.next();
        packageMetadataList.add(packageMetadata);
      }
    }
    catch (IOException e) {
      throw new IllegalArgumentException("Can't parse Release manifest YAML", e);
    }
  }
  return packageMetadataList;
}

代码示例来源:origin: spring-cloud/spring-cloud-skipper

protected List<PackageMetadata> deserializeFromIndexFiles(List<File> indexFiles) {
  List<PackageMetadata> packageMetadataList = new ArrayList<>();
  YAMLMapper yamlMapper = new YAMLMapper();
  yamlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  for (File indexFile : indexFiles) {
    try {
      MappingIterator<PackageMetadata> it = yamlMapper.readerFor(PackageMetadata.class).readValues(indexFile);
      while (it.hasNextValue()) {
        PackageMetadata packageMetadata = it.next();
        packageMetadataList.add(packageMetadata);
      }
    }
    catch (IOException e) {
      throw new IllegalArgumentException("Can't parse Release manifest YAML", e);
    }
  }
  return packageMetadataList;
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-skipper

mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try {
  MappingIterator<SpringCloudDeployerApplicationManifest> it = mapper.readerFor(
      SpringCloudDeployerApplicationManifest.class).readValues(manifest);
  while (it.hasNextValue()) {

代码示例来源:origin: spring-cloud/spring-cloud-skipper

mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try {
  MappingIterator<SpringCloudDeployerApplicationManifest> it = mapper.readerFor(
      SpringCloudDeployerApplicationManifest.class).readValues(manifest);
  while (it.hasNextValue()) {

代码示例来源:origin: spring-cloud/spring-cloud-skipper

@Override
public List<CloudFoundryApplicationSkipperManifest> read(String manifest) {
  if (canSupport(manifest)) {
    List<CloudFoundryApplicationSkipperManifest> applicationSpecs = new ArrayList<>();
    YAMLMapper mapper = new YAMLMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
    mapper.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE);
    try {
      MappingIterator<CloudFoundryApplicationSkipperManifest> it = mapper
                                .readerFor(CloudFoundryApplicationSkipperManifest.class)
                                .readValues(manifest);
      while (it.hasNextValue()) {
        CloudFoundryApplicationSkipperManifest appKind = it.next();
        applicationSpecs.add(appKind);
      }
    }
    catch (JsonMappingException e) {
      logger.error("Can't parse Package's manifest YAML = " + manifest);
      throw new SkipperException("JsonMappingException - Can't parse Package's manifest YAML = " + manifest,
          e);
    }
    catch (IOException e) {
      logger.error("Can't parse Package's manifest YAML = " + manifest);
      throw new SkipperException("IOException - Can't parse Package's manifest YAML = " + manifest, e);
    }
    return applicationSpecs;
  }
  return Collections.emptyList();
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-skipper

@Override
public List<CloudFoundryApplicationSkipperManifest> read(String manifest) {
  if (canSupport(manifest)) {
    List<CloudFoundryApplicationSkipperManifest> applicationSpecs = new ArrayList<>();
    YAMLMapper mapper = new YAMLMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
    mapper.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE);
    try {
      MappingIterator<CloudFoundryApplicationSkipperManifest> it = mapper
                                .readerFor(CloudFoundryApplicationSkipperManifest.class)
                                .readValues(manifest);
      while (it.hasNextValue()) {
        CloudFoundryApplicationSkipperManifest appKind = it.next();
        applicationSpecs.add(appKind);
      }
    }
    catch (JsonMappingException e) {
      logger.error("Can't parse Package's manifest YAML = " + manifest);
      throw new SkipperException("JsonMappingException - Can't parse Package's manifest YAML = " + manifest,
          e);
    }
    catch (IOException e) {
      logger.error("Can't parse Package's manifest YAML = " + manifest);
      throw new SkipperException("IOException - Can't parse Package's manifest YAML = " + manifest, e);
    }
    return applicationSpecs;
  }
  return Collections.emptyList();
}

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