Class RemappingReferenceMapper
- java.lang.Object
-
- org.spongepowered.asm.mixin.refmap.RemappingReferenceMapper
-
- All Implemented Interfaces:
IClassReferenceMapper,IReferenceMapper
public final class RemappingReferenceMapper extends java.lang.Object implements IClassReferenceMapper, IReferenceMapper
This adapter is designed to apply the same remapping used elsewhere in the development chain (RemapperChain) to reference maps.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContext()Get the current contextjava.lang.StringgetResourceName()Get the resource name this refmap was loaded from (if available).java.lang.StringgetStatus()Get a user-readable "status" string for this refmap for use in error messagesbooleanisDefault()Get whether this mapper is defaulted.static IReferenceMapperof(MixinEnvironment env, IReferenceMapper refMap)Wrap the specified refmap in a remapping adapter using settings in the supplied environmentjava.lang.Stringremap(java.lang.String className, java.lang.String reference)Remap a reference for the specified owning class in the current contextjava.lang.StringremapClassName(java.lang.String className, java.lang.String inputClassName)java.lang.StringremapClassNameWithContext(java.lang.String context, java.lang.String className, java.lang.String remapped)java.lang.StringremapWithContext(java.lang.String context, java.lang.String className, java.lang.String reference)Remap a reference for the specified owning class in the specified contextvoidsetContext(java.lang.String context)Set the current remap context, can be null
-
-
-
Method Detail
-
isDefault
public boolean isDefault()
Description copied from interface:IReferenceMapperGet whether this mapper is defaulted. Use this flag rather than reference comparison toReferenceMapper.DEFAULT_MAPPERbecause of classloader shenanigans- Specified by:
isDefaultin interfaceIReferenceMapper- Returns:
- true if this mapper is a defaulted mapper
-
getResourceName
public java.lang.String getResourceName()
Description copied from interface:IReferenceMapperGet the resource name this refmap was loaded from (if available).- Specified by:
getResourceNamein interfaceIReferenceMapper- Returns:
- name of the resource
-
getStatus
public java.lang.String getStatus()
Description copied from interface:IReferenceMapperGet a user-readable "status" string for this refmap for use in error messages- Specified by:
getStatusin interfaceIReferenceMapper- Returns:
- status message
-
getContext
public java.lang.String getContext()
Description copied from interface:IReferenceMapperGet the current context- Specified by:
getContextin interfaceIReferenceMapper- Returns:
- current context key, can be null
-
setContext
public void setContext(java.lang.String context)
Description copied from interface:IReferenceMapperSet the current remap context, can be null- Specified by:
setContextin interfaceIReferenceMapper- Parameters:
context- remap context
-
remap
public java.lang.String remap(java.lang.String className, java.lang.String reference)Description copied from interface:IReferenceMapperRemap a reference for the specified owning class in the current context- Specified by:
remapin interfaceIReferenceMapper- Parameters:
className- Owner classreference- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-
remapWithContext
public java.lang.String remapWithContext(java.lang.String context, java.lang.String className, java.lang.String reference)Description copied from interface:IReferenceMapperRemap a reference for the specified owning class in the specified context- Specified by:
remapWithContextin interfaceIReferenceMapper- Parameters:
context- Remap context to useclassName- Owner classreference- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-
of
public static IReferenceMapper of(MixinEnvironment env, IReferenceMapper refMap)
Wrap the specified refmap in a remapping adapter using settings in the supplied environment- Parameters:
env- environment to read configuration fromrefMap- refmap to wrap- Returns:
- wrapped refmap or original refmap is srg data is not available
-
remapClassName
public java.lang.String remapClassName(java.lang.String className, java.lang.String inputClassName)- Specified by:
remapClassNamein interfaceIClassReferenceMapper
-
remapClassNameWithContext
public java.lang.String remapClassNameWithContext(java.lang.String context, java.lang.String className, java.lang.String remapped)- Specified by:
remapClassNameWithContextin interfaceIClassReferenceMapper
-
-