本文整理了Java中com.sap.cloud.lm.sl.mta.util.YamlUtil
类的一些代码示例,展示了YamlUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlUtil
类的具体详情如下:
包路径:com.sap.cloud.lm.sl.mta.util.YamlUtil
类名称:YamlUtil
暂无
代码示例来源:origin: cloudfoundry-incubator/multiapps-controller
private static byte[] toBinaryYaml(Object object) {
String yaml = YamlUtil.convertToYaml(object);
return yaml.getBytes(StandardCharsets.UTF_8);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public ExtensionDescriptor parseExtensionDescriptorYaml(InputStream yaml) throws ParsingException {
// TODO: Java 9 - Remove the second variable (https://blogs.oracle.com/darcy/more-concise-try-with-resources-statements-in-jdk-9).
try (InputStream closableYaml = yaml) {
return parseExtensionDescriptor(YamlUtil.convertYamlToMap(closableYaml));
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
@SuppressWarnings("unchecked")
public static Map<String, Object> convertYamlToMap(String yaml) throws ParsingException {
try {
return (Map<String, Object>) new Yaml(new YamlTaggedObjectsConstructor()).load(yaml);
} catch (Exception e) {
throw new ParsingException(e, constructParsingExceptionMessage(e, yaml));
}
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
@SuppressWarnings("unchecked")
public static List<Object> convertYamlToList(String yaml) throws ParsingException {
try {
return (List<Object>) new Yaml(new YamlTaggedObjectsConstructor()).load(yaml);
} catch (Exception e) {
throw new ParsingException(e, constructParsingExceptionMessage(e, yaml));
}
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public DeploymentDescriptor parseDeploymentDescriptorYaml(InputStream yaml) throws ParsingException {
// TODO: Java 9 - Remove the second variable (https://blogs.oracle.com/darcy/more-concise-try-with-resources-statements-in-jdk-9).
try (InputStream closableYaml = yaml) {
return parseDeploymentDescriptor(YamlUtil.convertYamlToMap(closableYaml));
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
代码示例来源:origin: com.sap.cloud.lm.sl.cf/com.sap.cloud.lm.sl.cf.process
private static byte[] toBinaryYaml(Object object) {
String yaml = YamlUtil.convertToYaml(object);
return yaml.getBytes(StandardCharsets.UTF_8);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public ExtensionDescriptor parseExtensionDescriptor(String yaml) {
Map<String, Object> descriptor = YamlUtil.convertYamlToMap(yaml);
return parseExtensionDescriptor(descriptor);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public ExtensionDescriptor parseExtensionDescriptorYaml(String yaml) throws ParsingException {
return parseExtensionDescriptor(YamlUtil.convertYamlToMap(yaml));
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public DeploymentDescriptor parseDeploymentDescriptor(InputStream yaml) {
Map<String, Object> descriptor = YamlUtil.convertYamlToMap(yaml);
return parseDeploymentDescriptor(descriptor);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public DeploymentDescriptor parseDeploymentDescriptor(String yaml) {
Map<String, Object> descriptor = YamlUtil.convertYamlToMap(yaml);
return parseDeploymentDescriptor(descriptor);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public ExtensionDescriptor parseExtensionDescriptor(InputStream yaml) {
Map<String, Object> descriptor = YamlUtil.convertYamlToMap(yaml);
return parseExtensionDescriptor(descriptor);
}
代码示例来源:origin: com.sap.cloud.lm.sl/com.sap.cloud.lm.sl.mta
public DeploymentDescriptor parseDeploymentDescriptorYaml(String yaml) throws ParsingException {
return parseDeploymentDescriptor(YamlUtil.convertYamlToMap(yaml));
}
内容来源于网络,如有侵权,请联系作者删除!