Interface IReferenceMapper
- All Known Implementing Classes:
ReferenceMapper,RemappingReferenceMapper
public interface IReferenceMapper
Interface for reference mapper objects
-
Method Summary
Modifier and TypeMethodDescriptionGet the current contextGet the resource name this refmap was loaded from (if available).Get a user-readable "status" string for this refmap for use in error messagesbooleanGet whether this mapper is defaulted.Remap a reference for the specified owning class in the current contextremapWithContext(String context, String className, String reference) Remap a reference for the specified owning class in the specified contextvoidsetContext(String context) Set the current remap context, can be null
-
Method Details
-
isDefault
boolean isDefault()Get whether this mapper is defaulted. Use this flag rather than reference comparison toReferenceMapper.DEFAULT_MAPPERbecause of classloader shenanigans- Returns:
- true if this mapper is a defaulted mapper
-
getResourceName
String getResourceName()Get the resource name this refmap was loaded from (if available).- Returns:
- name of the resource
-
getStatus
String getStatus()Get a user-readable "status" string for this refmap for use in error messages- Returns:
- status message
-
getContext
String getContext()Get the current context- Returns:
- current context key, can be null
-
setContext
Set the current remap context, can be null- Parameters:
context- remap context
-
remap
Remap a reference for the specified owning class in the current context- Parameters:
className- Owner classreference- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-
remapWithContext
Remap a reference for the specified owning class in the specified context- Parameters:
context- Remap context to useclassName- Owner classreference- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-