Class YamlReader<T>

  • Type Parameters:
    T - the type to read
    All Implemented Interfaces:
    Closeable, AutoCloseable

    public class YamlReader<T>
    extends Object
    Wraps the YamlReader in order to implement Closeable.
    Author:
    aherscu
    • Field Detail

      • yamlStream

        protected final T yamlStream
    • Constructor Detail

      • YamlReader

        public YamlReader​(File from)
                   throws IOException
        Creates a file-based YAML reader; you should call Closeable.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)