Package net.fabricmc.loader.api
Interface MappingResolver
public interface MappingResolver
Helper class for performing mapping resolution.
Note: The target namespace (the one being mapped to) for mapping (or the source one for unmapping) is always implied to be the one Loader is currently operating in.
All the className
used in this resolver are in binary names,
such as "mypackage.MyClass$Inner"
.
- Since:
- 0.4.1
-
Method Summary
Modifier and Type Method Description String
getCurrentRuntimeNamespace()
Get the current namespace being used at runtime.Collection<String>
getNamespaces()
Get the list of all available mapping namespaces in the loaded instance.String
mapClassName(String namespace, String className)
Map a class name to the mapping currently used at runtime.String
mapFieldName(String namespace, String owner, String name, String descriptor)
Map a field name to the mapping currently used at runtime.String
mapMethodName(String namespace, String owner, String name, String descriptor)
Map a method name to the mapping currently used at runtime.String
unmapClassName(String targetNamespace, String className)
Unmap a class name to the mapping currently used at runtime.
-
Method Details
-
getNamespaces
Collection<String> getNamespaces()Get the list of all available mapping namespaces in the loaded instance.- Returns:
- The list of all available namespaces.
-
getCurrentRuntimeNamespace
String getCurrentRuntimeNamespace()Get the current namespace being used at runtime.- Returns:
- the runtime namespace
-
mapClassName
Map a class name to the mapping currently used at runtime.- Parameters:
namespace
- the namespace of the provided class nameclassName
- the provided binary class name- Returns:
- the mapped class name, or
className
if no such mapping is present
-
unmapClassName
Unmap a class name to the mapping currently used at runtime.- Parameters:
targetNamespace
- The target namespace for unmapping.className
- the provided binary class name of the mapping form currently used at runtime- Returns:
- the mapped class name, or
className
if no such mapping is present
-
mapFieldName
Map a field name to the mapping currently used at runtime.- Parameters:
namespace
- the namespace of the provided field name and descriptorowner
- the binary name of the owner class of the fieldname
- the name of the fielddescriptor
- the descriptor of the field- Returns:
- the mapped field name, or
name
if no such mapping is present
-
mapMethodName
Map a method name to the mapping currently used at runtime.- Parameters:
namespace
- the namespace of the provided method name and descriptorowner
- the binary name of the owner class of the methodname
- the name of the methoddescriptor
- the descriptor of the method- Returns:
- the mapped method name, or
name
if no such mapping is present
-