Class PluginYml
java.lang.Object
eu.hexagonmc.spigot.annotation.meta.PluginYml
Utility class for loading and saving plugin yaml files.
It serializes and deserializes
PluginMetadata to and from yaml
files.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PluginMetadataReads metadata from the given reader.static PluginMetadataReads metadata from the given path.static voidwrite(Writer writer, PluginMetadata meta) Writes metadata to the given writer.static voidwrite(Path path, PluginMetadata meta) Writes metadata to the given path.
-
Field Details
-
FILENAME_SPIGOT
The filename for Spigot plugins.- See Also:
-
FILENAME_BUNGEE
The filename for BungeeCord plugins.- See Also:
-
-
Constructor Details
-
PluginYml
public PluginYml()Throw exception if used. Utility classes should not be instanced.- Throws:
RuntimeException- if someone tries to call this constructor this class.
-
-
Method Details
-
read
Reads metadata from the given path.- Parameters:
path- The path to read from- Returns:
- The read metadata
- Throws:
IOException- if something goes wrong during load- See Also:
-
read
Reads metadata from the given reader.- Parameters:
reader- The reader to read from- Returns:
- The read metadata
- See Also:
-
write
Writes metadata to the given path.- Parameters:
path- The path to write tometa- The metadata to write- Throws:
IOException- if something goes wrong during save- See Also:
-
write
Writes metadata to the given writer.- Parameters:
writer- The writer to write tometa- The metadata to write- Throws:
IOException- if something goes wrong during save- See Also:
-