Package org.spongepowered.plugin.meta
Class McModInfo
java.lang.Object
org.spongepowered.plugin.meta.McModInfo
Represents a serializer for
PluginMetadata for the
mcmod.info file format.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a builder forMcModInfoserializes that can be used to construct a serializer that serializes specific extension keys to their Java object representation. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic McModInfo.Builderbuilder()Creates a newMcModInfo.Builderthat can be used to construct aMcModInfoserializer that serializes specific extension keys to their Java object representation.Deserializes the specified JSON string into aListofPluginMetadata.read(JsonReader reader) read(InputStream in) toJson(List<PluginMetadata> meta) Serializes the specifiedListofPluginMetadatato a JSON string.toJson(PluginMetadata... meta) Serializes the specifiedPluginMetadatato a JSON string.voidwrite(JsonWriter writer, List<PluginMetadata> meta) voidwrite(JsonWriter writer, PluginMetadata... meta) Writes the specifiedPluginMetadatato theJsonWriter.voidwrite(Writer writer, List<PluginMetadata> meta) voidwrite(Writer writer, PluginMetadata... meta) Writes the specifiedPluginMetadatato theWriter.voidwrite(Path path, List<PluginMetadata> meta) voidwrite(Path path, PluginMetadata... meta) Writes the specifiedPluginMetadatato the file represented by thePath.
-
Field Details
-
STANDARD_FILENAME
The file name the metadata is usually saved in.- See Also:
-
DEFAULT
The default serializer that converts all additional properties into standard Java types.
-
-
Method Details
-
fromJson
Deserializes the specified JSON string into aListofPluginMetadata.- Parameters:
json- The JSON string- Returns:
- The deserialized metadata list
-
read
- Parameters:
path- The path to the file- Returns:
- The deserialized metadata list
- Throws:
IOException- If an error occurs while reading
-
read
- Parameters:
in- The input stream- Returns:
- The deserialized metadata list
- Throws:
IOException- If an error occurs while reading
-
read
- Parameters:
reader- The reader- Returns:
- The deserialized metadata list
- Throws:
IOException- If an error occurs while reading
-
read
- Parameters:
reader- The JSON reader- Returns:
- The deserialized metadata list
- Throws:
IOException- If an error occurs while reading
-
toJson
Serializes the specifiedPluginMetadatato a JSON string.- Parameters:
meta- The plugin metadata to serialize- Returns:
- The serialized JSON string
-
toJson
Serializes the specifiedListofPluginMetadatato a JSON string.- Parameters:
meta- The plugin metadata to serialize- Returns:
- The serialized JSON string
-
write
Writes the specifiedPluginMetadatato the file represented by thePath.- Parameters:
path- The path to the file to write tometa- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
write
- Parameters:
path- The path to the file to write tometa- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
write
Writes the specifiedPluginMetadatato theWriter.- Parameters:
writer- The writermeta- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
write
- Parameters:
writer- The writermeta- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
write
Writes the specifiedPluginMetadatato theJsonWriter.- Parameters:
writer- The JSON writermeta- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
write
- Parameters:
writer- The JSON writermeta- The plugin metadata to serialize- Throws:
IOException- If an error occurs while writing
-
builder
Creates a newMcModInfo.Builderthat can be used to construct aMcModInfoserializer that serializes specific extension keys to their Java object representation.- Returns:
- A new builder
-