public class YamlUtil extends Object
Constructor and Description |
---|
YamlUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
dump(Object object,
Writer writer)
将Bean对象或者Map写出到
Writer |
static void |
dump(Object object,
Writer writer,
org.yaml.snakeyaml.DumperOptions dumperOptions)
将Bean对象或者Map写出到
Writer |
static <T> T |
load(InputStream in,
Class<T> type)
从流中加载YAML
|
static Dict |
load(Reader reader)
加载YAML,加载完毕后关闭
Reader |
static <T> T |
load(Reader reader,
Class<T> type)
加载YAML,加载完毕后关闭
Reader |
static <T> T |
load(Reader reader,
Class<T> type,
boolean isCloseReader)
加载YAML
|
static Dict |
loadByPath(String path)
从classpath或绝对路径加载YAML文件
|
static <T> T |
loadByPath(String path,
Class<T> type)
从classpath或绝对路径加载YAML文件
|
public static Dict loadByPath(String path)
path
- YAML路径,相对路径相对classpathpublic static <T> T loadByPath(String path, Class<T> type)
T
- Bean类型,默认mappath
- YAML路径,相对路径相对classpathtype
- 加载的Bean类型,即转换为的beanpublic static <T> T load(InputStream in, Class<T> type)
T
- Bean类型,默认mapin
- 流type
- 加载的Bean类型,即转换为的beanpublic static Dict load(Reader reader)
Reader
reader
- Reader
public static <T> T load(Reader reader, Class<T> type)
Reader
T
- Bean类型,默认mapreader
- Reader
type
- 加载的Bean类型,即转换为的beanpublic static void dump(Object object, Writer writer)
Writer
object
- 对象writer
- Writer
Copyright © 2024. All rights reserved.