Class YamlReader<T>
- java.lang.Object
-
- dev.aherscu.qa.testing.extra.yaml.YamlReader<T>
-
- Type Parameters:
T
- the type to read
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class YamlReader<T> extends Object
Wraps theYamlReader
in order to implementCloseable
.- Author:
- aherscu
-
-
Field Summary
Fields Modifier and Type Field Description protected T
yamlStream
-
Constructor Summary
Constructors Constructor Description YamlReader(File from)
Creates a file-based YAML reader; you should callCloseable.close()
in order to release it.YamlReader(Reader reader)
-
-
-
Constructor Detail
-
YamlReader
public YamlReader(File from) throws IOException
Creates a file-based YAML reader; you should callCloseable.close()
in order to release it.- Parameters:
from
- the file to read from- Throws:
IOException
- if the file cannot be open for reading- See Also:
YamlReader(Reader)
-
YamlReader
public YamlReader(Reader reader)
- Parameters:
reader
- the reader- See Also:
YamlReader(Reader)
-
-
Method Detail
-
read
public T read(Class<T> type) throws com.esotericsoftware.yamlbeans.YamlException
- Parameters:
type
- the type to read- Returns:
- object read
- Throws:
com.esotericsoftware.yamlbeans.YamlException
- if anything fails- See Also:
YamlReader.read(Class)
-
close
public final void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-