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
Modifier and TypeClassDescriptionstatic final class
Represents a builder forMcModInfo
serializes that can be used to construct a serializer that serializes specific extension keys to their Java object representation. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic McModInfo.Builder
builder()
Creates a newMcModInfo.Builder
that can be used to construct aMcModInfo
serializer that serializes specific extension keys to their Java object representation.Deserializes the specified JSON string into aList
ofPluginMetadata
.read
(JsonReader reader) read
(InputStream in) toJson
(List<PluginMetadata> meta) Serializes the specifiedList
ofPluginMetadata
to a JSON string.toJson
(PluginMetadata... meta) Serializes the specifiedPluginMetadata
to a JSON string.void
write
(JsonWriter writer, List<PluginMetadata> meta) void
write
(JsonWriter writer, PluginMetadata... meta) Writes the specifiedPluginMetadata
to theJsonWriter
.void
write
(Writer writer, List<PluginMetadata> meta) void
write
(Writer writer, PluginMetadata... meta) Writes the specifiedPluginMetadata
to theWriter
.void
write
(Path path, List<PluginMetadata> meta) void
write
(Path path, PluginMetadata... meta) Writes the specifiedPluginMetadata
to 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 aList
ofPluginMetadata
.- 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 specifiedPluginMetadata
to a JSON string.- Parameters:
meta
- The plugin metadata to serialize- Returns:
- The serialized JSON string
-
toJson
Serializes the specifiedList
ofPluginMetadata
to a JSON string.- Parameters:
meta
- The plugin metadata to serialize- Returns:
- The serialized JSON string
-
write
Writes the specifiedPluginMetadata
to 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 specifiedPluginMetadata
to 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 specifiedPluginMetadata
to 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.Builder
that can be used to construct aMcModInfo
serializer that serializes specific extension keys to their Java object representation.- Returns:
- A new builder
-