Class YamlReader

java.lang.Object
be.dezijwegel.betteryaml.files.YamlReader

public class YamlReader
extends Object
  • Constructor Summary

    Constructors
    Constructor Description
    YamlReader​(File file)
    Creates a YamlReader from a given File YamlReader supports nested keys All key-value pairs will be added to a Map
    YamlReader​(InputStream fis)
    Creates a YamlReader from a given InputStream YamlReader supports nested keys All key-value pairs will be added to a Map
  • Method Summary

    Modifier and Type Method Description
    Map<String,​Object> getContents()
    Get the contents from the provided File or InputStream ConfigurationSections are not added separately Nested keys are saved as: section.subsection.option

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • YamlReader

      public YamlReader​(File file) throws IOException
      Creates a YamlReader from a given File YamlReader supports nested keys All key-value pairs will be added to a Map
      Parameters:
      file - the file to be read
      Throws:
      IOException - when a stream cannot be created or the file does not exist
    • YamlReader

      public YamlReader​(InputStream fis) throws IOException
      Creates a YamlReader from a given InputStream YamlReader supports nested keys All key-value pairs will be added to a Map
      Parameters:
      fis - the InputStream to be read
      Throws:
      IOException - when a stream cannot be created or the file does not exist
  • Method Details

    • getContents

      public Map<String,​Object> getContents()
      Get the contents from the provided File or InputStream ConfigurationSections are not added separately Nested keys are saved as: section.subsection.option
      Returns:
      all keys and their mapped values from within the file