public class YamlUtil extends Object
Modifier and Type | Class and Description |
---|---|
class |
YamlUtil.MyPropertyUtils
The type My property utils.
|
protected class |
YamlUtil.StrictMapAppenderConstructor
The type Strict map appender constructor.
|
Constructor and Description |
---|
YamlUtil() |
Modifier and Type | Method and Description |
---|---|
<T> org.yaml.snakeyaml.constructor.Constructor |
getConstructor(Class<T> typClass)
Gets constructor.
|
protected org.yaml.snakeyaml.introspector.PropertyUtils |
getPropertyUtils()
Gets property utils.
|
boolean |
isYamlFileContentValid(String yamlFullFileName)
Is yaml file content valid boolean.
|
InputStream |
loadYamlFileIs(String yamlFullFileName)
Load yaml file is input stream.
|
<T> String |
objectToYaml(Object obj)
Object to yaml string.
|
Map<String,LinkedHashMap<String,Object>> |
yamlToMap(InputStream yamlContent)
Yaml to map map.
|
<T> T |
yamlToObject(InputStream yamlContent,
Class<T> typClass)
Yaml to object t.
|
<T> T |
yamlToObject(String yamlContent,
Class<T> typClass)
Yaml to object t.
|
public <T> T yamlToObject(String yamlContent, Class<T> typClass)
T
- the type parameteryamlContent
- the yaml contenttypClass
- the typ classpublic <T> T yamlToObject(InputStream yamlContent, Class<T> typClass)
T
- the type parameteryamlContent
- the yaml contenttypClass
- the typ classpublic <T> org.yaml.snakeyaml.constructor.Constructor getConstructor(Class<T> typClass)
T
- the type parametertypClass
- the typ classprotected org.yaml.snakeyaml.introspector.PropertyUtils getPropertyUtils()
public Map<String,LinkedHashMap<String,Object>> yamlToMap(InputStream yamlContent)
yamlContent
- the yaml contentpublic <T> String objectToYaml(Object obj)
T
- the type parameterobj
- the objpublic InputStream loadYamlFileIs(String yamlFullFileName)
yamlFullFileName
- the yaml full file namepublic boolean isYamlFileContentValid(String yamlFullFileName)
yamlFullFileName
- the yaml full file nameCopyright © 2017. All rights reserved.