Class ProGuardFileWriter
java.lang.Object
net.fabricmc.mappingio.format.proguard.ProGuardFileWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,MappingVisitor,MappingWriter
A mapping writer for the ProGuard mapping format.
Note that this format is very basic: it only supports
one namespace pair and only classes, methods and fields
without comments.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProGuardFileWriter(Writer writer) Constructs a ProGuard mapping writer that uses the first destination namespace (index 0).ProGuardFileWriter(Writer writer, int dstNamespace) Constructs a ProGuard mapping writer.ProGuardFileWriter(Writer writer, String dstNamespace) Constructs a ProGuard mapping writer. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the internalWriter.booleanvisitClass(String srcName) voidvisitComment(MappedElementKind targetKind, String comment) Comment for the specified element (last content-visited or any parent).voidvisitDstName(MappedElementKind targetKind, int namespace, String name) Destination name for the current element.booleanvisitField(String srcName, @Nullable String srcDesc) booleanvisitMethod(String srcName, @Nullable String srcDesc) booleanvisitMethodArg(int argPosition, int lvIndex, @Nullable String srcName) booleanvisitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable String srcName) voidvisitNamespaces(String srcNamespace, List<String> dstNamespaces) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.mappingio.MappingVisitor
getFlags, reset, visitContent, visitDstDesc, visitElementContent, visitHeader, visitMetadataMethods inherited from interface net.fabricmc.mappingio.MappingWriter
visitEnd
-
Constructor Details
-
ProGuardFileWriter
Constructs a ProGuard mapping writer that uses the first destination namespace (index 0).- Parameters:
writer- the writer where the mappings will be written
-
ProGuardFileWriter
Constructs a ProGuard mapping writer.- Parameters:
writer- the writer where the mappings will be writtendstNamespace- the namespace index to write as the destination namespace, must be at least 0
-
ProGuardFileWriter
Constructs a ProGuard mapping writer.- Parameters:
writer- the writer where the mappings will be writtendstNamespace- the namespace name to write as the destination namespace
-
-
Method Details
-
close
Closes the internalWriter.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an IO error occurs
-
visitNamespaces
- Specified by:
visitNamespacesin interfaceMappingVisitor- Throws:
IOException
-
visitClass
- Specified by:
visitClassin interfaceMappingVisitor- Throws:
IOException
-
visitField
- Specified by:
visitFieldin interfaceMappingVisitor- Throws:
IOException
-
visitMethod
- Specified by:
visitMethodin interfaceMappingVisitor- Throws:
IOException
-
visitMethodArg
public boolean visitMethodArg(int argPosition, int lvIndex, @Nullable @Nullable String srcName) throws IOException - Specified by:
visitMethodArgin interfaceMappingVisitor- Throws:
IOException
-
visitMethodVar
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable @Nullable String srcName) throws IOException - Specified by:
visitMethodVarin interfaceMappingVisitor- Throws:
IOException
-
visitDstName
public void visitDstName(MappedElementKind targetKind, int namespace, String name) throws IOException Description copied from interface:MappingVisitorDestination name for the current element.- Specified by:
visitDstNamein interfaceMappingVisitor- Parameters:
namespace- namespace index, index into the dstNamespaces List inMappingVisitor.visitNamespaces(java.lang.String, java.util.List<java.lang.String>)name- destination name- Throws:
IOException
-
visitComment
Description copied from interface:MappingVisitorComment for the specified element (last content-visited or any parent).- Specified by:
visitCommentin interfaceMappingVisitor- Parameters:
comment- comment as a potentially multi-line string- Throws:
IOException
-