Class MappingSourceNsSwitch

java.lang.Object
net.fabricmc.mappingio.adapter.ForwardingMappingVisitor
net.fabricmc.mappingio.adapter.MappingSourceNsSwitch
All Implemented Interfaces:
MappingVisitor

public final class MappingSourceNsSwitch extends ForwardingMappingVisitor
Adapter switching the source namespace with one of the destination namespaces.

This adapts e.g. "src -> dstA, dstB, dstC, ..." mappings to "dstB -> dstA, src, dstC, ..." with a pre-pass to build a class map for descriptor remapping.

After gathering the class map, the implementation delays src-named visit* invocations until the replacement dst name is known, then replays it with the adjusted names.

By default elements without a name in newSourceNs will keep using the original srcName. This behavior can be changed by setting dropMissingNewSrcName to true in the constructor.