Package com.kamikazejam.kamicommon.yaml
Class AbstractYamlHandler<T extends AbstractYamlConfiguration>
java.lang.Object
com.kamikazejam.kamicommon.yaml.AbstractYamlHandler<T>
- Direct Known Subclasses:
YamlHandlerStandalone
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractConfig<?>
protected T
protected final File
protected final @Nullable Supplier<InputStream>
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractYamlHandler
(AbstractConfig<?> abstractConfig, File configFile, @Nullable Supplier<InputStream> defaultsStream) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyCommentsFromDefault
(AbstractYamlConfiguration config, List<AbstractYamlHandler.NodePair> keyNodes, boolean defOverwrites) static org.yaml.snakeyaml.nodes.MappingNode
abstract void
abstract T
abstract MemorySectionMethods<?>
newMemorySection
(org.yaml.snakeyaml.nodes.MappingNode node) abstract void
-
Field Details
-
abstractConfig
-
configFile
-
fileName
-
defaultsStream
-
config
-
-
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
-
newMemorySection
-
loadConfig
-
createNewMappingNode
public static org.yaml.snakeyaml.nodes.MappingNode createNewMappingNode() -
error
-
warn
-
copyCommentsFromDefault
public static void copyCommentsFromDefault(AbstractYamlConfiguration config, List<AbstractYamlHandler.NodePair> keyNodes, boolean defOverwrites) - Parameters:
config
- The config to copy comments tokeyNodes
- NodePairs of the keys to copy comments from
-