Package org.cadixdev.lorenz.io
Interface MappingFormat
-
- All Known Subinterfaces:
TextMappingFormat
- All Known Implementing Classes:
CSrgMappingFormat,SrgMappingFormat,TSrgMappingFormat,XSrgMappingFormat
public interface MappingFormatA representation of a de-obfuscation mapping format.- Since:
- 0.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MappingsReadercreateReader(java.io.InputStream stream)Creates aMappingsReaderfrom the givenInputStreamfor the mapping format.default MappingsReadercreateReader(java.nio.file.Path path)Creates aMappingsReaderfor the given mappings filePathfor the mapping format.MappingsWritercreateWriter(java.io.OutputStream stream)Creates aMappingsWriterfrom the givenOutputStreamfor the mapping format.default MappingsWritercreateWriter(java.nio.file.Path path)Creates aMappingsWriterfor the given mappings filePathfor the mapping format.java.util.Optional<java.lang.String>getStandardFileExtension()Gets the typically used file extension for the format, if available.default MappingSetread(java.nio.file.Path path)Reads a mappings file into aMappingSet.default MappingSetread(MappingSet mappings, java.nio.file.Path path)Reads a mappings file into the givenMappingSet.default voidwrite(MappingSet mappings, java.nio.file.Path path)Writes a mapping set to file.default voidwrite(MappingSet mappings, java.nio.file.Path path, MappingsWriterConfig config)Writes a mapping set to file, applying the givenwriter configurationbefore writing.
-
-
-
Method Detail
-
createReader
MappingsReader createReader(java.io.InputStream stream) throws java.io.IOException
Creates aMappingsReaderfrom the givenInputStreamfor the mapping format.- Parameters:
stream- The input stream- Returns:
- The mapping reader
- Throws:
java.io.IOException- Should an I/O issue occurjava.lang.UnsupportedOperationException- If the format does not support reading
-
createReader
default MappingsReader createReader(java.nio.file.Path path) throws java.io.IOException
Creates aMappingsReaderfor the given mappings filePathfor the mapping format.- Parameters:
path- The path to the mappings file- Returns:
- The mapping reader
- Throws:
java.io.IOException- Should an I/O issue occurjava.lang.UnsupportedOperationException- If the format does not support reading
-
read
default MappingSet read(MappingSet mappings, java.nio.file.Path path) throws java.io.IOException
Reads a mappings file into the givenMappingSet.- Parameters:
mappings- The mapping set to read in topath- The path of the mappings file- Returns:
- The mappings
- Throws:
java.io.IOException- Should an I/O issue occur
-
read
default MappingSet read(java.nio.file.Path path) throws java.io.IOException
Reads a mappings file into aMappingSet.- Parameters:
path- The path of the mappings file- Returns:
- The mappings
- Throws:
java.io.IOException- Should an I/O issue occur
-
createWriter
MappingsWriter createWriter(java.io.OutputStream stream) throws java.io.IOException
Creates aMappingsWriterfrom the givenOutputStreamfor the mapping format.- Parameters:
stream- The output stream- Returns:
- The mapping writer
- Throws:
java.io.IOException- Should an I/O issue occurjava.lang.UnsupportedOperationException- If the format does not support writing
-
createWriter
default MappingsWriter createWriter(java.nio.file.Path path) throws java.io.IOException
Creates aMappingsWriterfor the given mappings filePathfor the mapping format.- Parameters:
path- The path to the mappings file- Returns:
- The mapping writer
- Throws:
java.io.IOException- Should an I/O issue occurjava.lang.UnsupportedOperationException- If the format does not support writing
-
write
default void write(MappingSet mappings, java.nio.file.Path path) throws java.io.IOException
Writes a mapping set to file.- Parameters:
mappings- The mapping set to writepath- The path of the mappings file- Throws:
java.io.IOException- Should an I/O issue occur
-
write
default void write(MappingSet mappings, java.nio.file.Path path, MappingsWriterConfig config) throws java.io.IOException
Writes a mapping set to file, applying the givenwriter configurationbefore writing.- Parameters:
mappings- The mapping set to writepath- The path of the mappings fileconfig- The writer configuration- Throws:
java.io.IOException- Should an I/O issue occur- Since:
- 0.5.5
-
getStandardFileExtension
java.util.Optional<java.lang.String> getStandardFileExtension()
Gets the typically used file extension for the format, if available.- Returns:
- The standard file extension
-
-