Class YamlWriter<T>

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

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

      • yamlStream

        protected final T yamlStream
    • Constructor Detail

      • YamlWriter

        public YamlWriter​(File file)
                   throws IOException
        Creates a YAML writer based on a supplied file; you should call Closeable.close() in order to release it.
        Parameters:
        file - the file
        Throws:
        IOException - if failed to write to file
      • YamlWriter

        public YamlWriter​(Writer writer)
        Parameters:
        writer - the writer
        See Also:
        YamlWriter(Writer)
    • Method Detail

      • write

        public void write​(T object)
                   throws com.esotericsoftware.yamlbeans.YamlException
        Parameters:
        object - the type to read
        Throws:
        com.esotericsoftware.yamlbeans.YamlException - if anything fails
        See Also:
        YamlWriter.write(Object)