作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.fasterxml.jackson.dataformat.yaml.YAMLMapper.readerFor()
方法的一些代码示例,展示了YAMLMapper.readerFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLMapper.readerFor()
方法的具体详情如下:
包路径:com.fasterxml.jackson.dataformat.yaml.YAMLMapper
类名称: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();
}
本文整理了Java中com.fasterxml.jackson.dataformat.yaml.YAMLMapper.readerFor()方法的一些代码示例,展示了YAMLMapper.reader
我是一名优秀的程序员,十分优秀!