Interface IReferenceMapper

All Known Implementing Classes:
ReferenceMapper, RemappingReferenceMapper

public interface IReferenceMapper
Interface for reference mapper objects
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current context
    Get the resource name this refmap was loaded from (if available).
    Get a user-readable "status" string for this refmap for use in error messages
    boolean
    Get whether this mapper is defaulted.
    remap(String className, String reference)
    Remap a reference for the specified owning class in the current context
    remapWithContext(String context, String className, String reference)
    Remap a reference for the specified owning class in the specified context
    void
    setContext(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 to ReferenceMapper.DEFAULT_MAPPER because 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

      void setContext(String context)
      Set the current remap context, can be null
      Parameters:
      context - remap context
    • remap

      String remap(String className, String reference)
      Remap a reference for the specified owning class in the current context
      Parameters:
      className - Owner class
      reference - Reference to remap
      Returns:
      remapped reference, returns original reference if not remapped
    • remapWithContext

      String remapWithContext(String context, String className, String reference)
      Remap a reference for the specified owning class in the specified context
      Parameters:
      context - Remap context to use
      className - Owner class
      reference - Reference to remap
      Returns:
      remapped reference, returns original reference if not remapped