public class YamlFileResource extends Object implements PropertyResource
| Constructor and Description |
|---|
YamlFileResource(@NotNull File file)
Deprecated.
scheduled for removal
|
YamlFileResource(@NotNull Path path) |
YamlFileResource(@NotNull Path path,
@NotNull YamlFileResourceOptions options) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createAndAddYamlNode(@NotNull Object exportValue,
@NotNull String path,
@NotNull List<PropertyPathTraverser.PathElement> pathElements,
@NotNull SnakeYamlNodeContainer rootContainer,
@NotNull ConfigurationData configurationData,
@NotNull SnakeYamlNodeBuilder nodeBuilder)
Creates a YAML node for the export value and stores it, along with any comments for intermediate paths that
have not been visited yet.
|
protected @NotNull org.yaml.snakeyaml.Yaml |
createNewYaml()
Creates a new SnakeYAML object with the appropriate options.
|
protected @NotNull SnakeYamlNodeBuilder |
createNodeBuilder() |
protected @NotNull SnakeYamlNodeContainer |
createNodeContainerForRoot(@NotNull List<String> rootComments) |
@NotNull PropertyReader |
createReader()
Creates a reader to access the values in the medium (typically a file).
|
void |
exportProperties(@NotNull ConfigurationData configurationData)
Exports the provided configuration data to the medium (typically a file).
|
protected @NotNull List<String> |
getCommentsForPathElement(@NotNull ConfigurationData configurationData,
@NotNull PropertyPathTraverser.PathElement pathElement) |
protected @NotNull File |
getFile()
Deprecated.
|
protected @NotNull YamlFileResourceOptions |
getOptions() |
protected @NotNull Path |
getPath() |
protected @NotNull org.yaml.snakeyaml.Yaml |
getYamlObject()
Returns the YAML instance with which values are converted to YAML.
|
protected void |
onWriteComplete()
Called at the end of
exportProperties(ch.jalu.configme.configurationdata.ConfigurationData), regardless whether the execution was successful or not. |
public YamlFileResource(@NotNull
@NotNull Path path)
public YamlFileResource(@NotNull
@NotNull Path path,
@NotNull
@NotNull YamlFileResourceOptions options)
@Deprecated public YamlFileResource(@NotNull @NotNull File file)
YamlFileResource(Path).file - the file@NotNull public @NotNull PropertyReader createReader()
PropertyResourceThe reader is discarded after its use and so is not required to refresh itself.
createReader in interface PropertyResourcepublic void exportProperties(@NotNull
@NotNull ConfigurationData configurationData)
PropertyResourceexportProperties in interface PropertyResourceconfigurationData - the configuration data to exportprotected void createAndAddYamlNode(@NotNull
@NotNull Object exportValue,
@NotNull
@NotNull String path,
@NotNull
@NotNull List<PropertyPathTraverser.PathElement> pathElements,
@NotNull
@NotNull SnakeYamlNodeContainer rootContainer,
@NotNull
@NotNull ConfigurationData configurationData,
@NotNull
@NotNull SnakeYamlNodeBuilder nodeBuilder)
exportValue - the export value to storepath - the path the export value is forpathElements - the path elements of this property's pathrootContainer - the root YAML node container for storing the export valueconfigurationData - the configuration data (for the retrieval of comments)nodeBuilder - YAML node builder@NotNull protected @NotNull List<String> getCommentsForPathElement(@NotNull @NotNull ConfigurationData configurationData, @NotNull @NotNull PropertyPathTraverser.PathElement pathElement)
@NotNull protected final @NotNull Path getPath()
@Deprecated @NotNull protected final @NotNull File getFile()
protected void onWriteComplete()
exportProperties(ch.jalu.configme.configurationdata.ConfigurationData), regardless whether the execution was successful or not.@NotNull protected @NotNull org.yaml.snakeyaml.Yaml getYamlObject()
@NotNull protected @NotNull org.yaml.snakeyaml.Yaml createNewYaml()
@NotNull protected final @NotNull YamlFileResourceOptions getOptions()
@NotNull protected @NotNull SnakeYamlNodeBuilder createNodeBuilder()
@NotNull protected @NotNull SnakeYamlNodeContainer createNodeContainerForRoot(@NotNull @NotNull List<String> rootComments)
Copyright © 2016–2023 The AuthMe Team. All rights reserved.