Class MetadataParser
java.lang.Object
org.spongepowered.plugin.metadata.builtin.MetadataParser
- 
Method SummaryModifier and TypeMethodDescriptionstatic GsonBuilderstatic MetadataContainerReads acontainerfrom a givenreaderusing the defaultdeserializer(retrieved fromgsonBuilder()).static MetadataContainerstatic MetadataContainerstatic MetadataContainerstatic voidwrite(Writer writer, MetadataContainer container, Gson gson, boolean indent) static voidwrite(Path path, MetadataContainer container, Gson gson, boolean indent) 
- 
Method Details- 
gsonBuilder
- 
read- Parameters:
- path- The path
- Returns:
- The container
- Throws:
- IOException- if the container fails to be read
 
- 
readReads acontainerfrom a givenpathwith configureddeserializer.To get a standard deserializer, gsonBuilder()is available.- Parameters:
- path- The path
- gson- The deserializer
- Returns:
- The container
- Throws:
- IOException- if the container fails to be read
 
- 
readReads acontainerfrom a givenreaderusing the defaultdeserializer(retrieved fromgsonBuilder()).- Parameters:
- reader- The reader
- Returns:
- The container
- Throws:
- IOException- if the container fails to be read
 
- 
readReads acontainerfrom a givenreaderwith configureddeserializer.To get a standard deserializer, gsonBuilder()is available.- Parameters:
- reader- The reader
- gson- The deserializer
- Returns:
- The container
- Throws:
- IOException- if the container fails to deserialize
 
- 
writepublic static void write(Path path, MetadataContainer container, Gson gson, boolean indent) throws IOException Writes acontainerto the givenpathusing the configuredserializer.To get a standard serializer, gsonBuilder()is available.- Parameters:
- path- The path
- container- The container
- gson- The serializer
- indent- True to indent (pretty print) the resulting JSON, false if not
- Throws:
- IOException- If the container fails to serialize
 
- 
writepublic static void write(Writer writer, MetadataContainer container, Gson gson, boolean indent) throws IOException Writes acontainerto the givenpathusing the configuredserializer.To get a standard serializer, gsonBuilder()is available.- Parameters:
- writer- The writer
- container- The container
- gson- The serializer
- indent- True to indent (pretty print) the resulting JSON, false if not
- Throws:
- IOException- If the container fails to serialize
 
 
-