Package net.fabricmc.mappingio.format
Class ProGuardWriter
java.lang.Object
net.fabricmc.mappingio.format.ProGuardWriter
- 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
ConstructorsConstructorDescriptionProGuardWriter(Writer writer) Constructs a ProGuard mapping writer that uses the first destination namespace (index 0).ProGuardWriter(Writer writer, int dstNamespace) Constructs a ProGuard mapping writer.ProGuardWriter(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, String srcDesc) booleanvisitMethod(String srcName, String srcDesc) booleanvisitMethodArg(int argPosition, int lvIndex, String srcName) booleanvisitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, 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, visitEnd, visitHeader, visitMetadata
-
Constructor Details
-
ProGuardWriter
Constructs a ProGuard mapping writer that uses the first destination namespace (index 0).- Parameters:
writer- the writer where the mappings will be written
-
ProGuardWriter
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
-
ProGuardWriter
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
- Specified by:
visitMethodArgin interfaceMappingVisitor- Throws:
IOException
-
visitMethodVar
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, 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 interfaceMappingVisitornamespace- 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 interfaceMappingVisitorcomment- comment as a potentially multi-line string- Throws:
IOException
-