Class ConfigWriter


  • public class ConfigWriter
    extends java.lang.Object
    Writer for parsing Config into file-lines.

    ConfigReader can write a single file at a time, so it is NOT thread safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigWriter()
      Create a new ConfigWriter that doesn't write anywhere.
      ConfigWriter​(java.nio.file.Path outputPath)
      Create a new ConfigWriter that writes to a Path.
    • Constructor Detail

      • ConfigWriter

        public ConfigWriter()
        Create a new ConfigWriter that doesn't write anywhere.
      • ConfigWriter

        public ConfigWriter​(java.nio.file.Path outputPath)
        Create a new ConfigWriter that writes to a Path.
        Parameters:
        outputPath - Path to write to.
    • Method Detail

      • write

        public void write​(ConfigNode writing)
                   throws java.io.IOException
        Write a ConfigNode into the given resource.
        Parameters:
        writing - ConfigNode to write.
        Throws:
        java.io.IOException - If the Path given to constructor can not be written to.
        java.lang.IllegalStateException - If the Path is null
      • createLines

        public java.util.List<java.lang.String> createLines​(ConfigNode writing)
        Parse the lines of a ConfigNode.

        "Write" the lines into a List.

        Parameters:
        writing - ConfigNode to "write"
        Returns:
        List of lines that would be written.