Interface IReferenceMapper
-
- All Known Implementing Classes:
ReferenceMapper,RemappingReferenceMapper
public interface IReferenceMapperInterface for reference mapper objects
-
-
Method Summary
All Methods Instance Methods Abstract 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.java.lang.Stringremap(java.lang.String className, java.lang.String reference)Remap a reference for the specified owning class in the current contextjava.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
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
java.lang.String getResourceName()
Get the resource name this refmap was loaded from (if available).- Returns:
- name of the resource
-
getStatus
java.lang.String getStatus()
Get a user-readable "status" string for this refmap for use in error messages- Returns:
- status message
-
getContext
java.lang.String getContext()
Get the current context- Returns:
- current context key, can be null
-
setContext
void setContext(java.lang.String context)
Set the current remap context, can be null- Parameters:
context- remap context
-
remap
java.lang.String remap(java.lang.String className, java.lang.String reference)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
java.lang.String remapWithContext(java.lang.String context, java.lang.String className, java.lang.String reference)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
-
-