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(@NotNull @NotNull AbstractConfig<?> abstractConfig, @NotNull @NotNull ConfigSource source, @Nullable @Nullable Supplier<InputStream> defaultsStream)
      Parameters:
      abstractConfig - The parent config instance who holds this handler.
      source - The source of the configuration file (yaml content).
      defaultsStream - An optional stream (of a YAML config) to read default values from, can be null.
  • Method Details

    • newConfig

      @NotNull public abstract T newConfig(@NotNull @NotNull org.yaml.snakeyaml.nodes.MappingNode node, @NotNull @NotNull ConfigSource source)
    • newMemorySection

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

      public abstract void error(String s)
    • warn

      public abstract void warn(String s)
    • loadConfig

      @NotNull public T loadConfig()
    • save

      @Internal public boolean save()
      Saves the config to the file
      Returns:
      true IFF the config was saved successfully (can be skipped if the config is not changed)
    • createNewMappingNode

      @NotNull public static @NotNull org.yaml.snakeyaml.nodes.MappingNode createNewMappingNode()