Class AbstractYamlHandler<T extends AbstractYamlConfiguration>

java.lang.Object
com.kamikazejam.kamicommon.yaml.AbstractYamlHandler<T>
Direct Known Subclasses:
YamlHandlerStandalone

public abstract class AbstractYamlHandler<T extends AbstractYamlConfiguration> extends Object
  • Field Details

  • Constructor Details

    • AbstractYamlHandler

      public AbstractYamlHandler(AbstractConfig<?> abstractConfig, File configFile, @Nullable @Nullable Supplier<InputStream> defaultsStream)
      Parameters:
      abstractConfig - The parent config instance who holds this handler.
      configFile - The file to read/write the configuration to/from.
      defaultsStream - An optional stream (of a YAML config) to read default values from, can be null.
  • Method Details

    • newConfig

      public abstract T newConfig(org.yaml.snakeyaml.nodes.MappingNode node, File configFile)
    • newMemorySection

      public abstract MemorySectionMethods<?> newMemorySection(org.yaml.snakeyaml.nodes.MappingNode node)
    • loadConfig

      @NotNull public T loadConfig()
    • createNewMappingNode

      public static org.yaml.snakeyaml.nodes.MappingNode createNewMappingNode()
    • error

      public abstract void error(String s)
    • warn

      public abstract void warn(String s)
    • copyCommentsFromDefault

      public static void copyCommentsFromDefault(AbstractYamlConfiguration config, List<AbstractYamlHandler.NodePair> keyNodes, boolean defOverwrites)
      Parameters:
      config - The config to copy comments to
      keyNodes - NodePairs of the keys to copy comments from