Class Mapper


  • public class Mapper
    extends java.lang.Object
    An object containing parsed mapping data, which can apply a conversion as requested.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​ClassData> mappings
      A Map tying each plain class name to its class data.
    • Constructor Summary

      Constructors 
      Constructor Description
      Mapper()  
    • Field Detail

      • mappings

        protected final java.util.Map<java.lang.String,​ClassData> mappings
        A Map tying each plain class name to its class data.
    • Constructor Detail

      • Mapper

        public Mapper()
    • Method Detail

      • getMethodData

        public MethodData getMethodData​(java.lang.String parent,
                                        java.lang.String name,
                                        java.lang.String descriptor)
                                 throws MappingNotFoundException
        Gets the mapped name of a method
        Parameters:
        parent - the plain internal name of the parent class
        name - the plain method name
        descriptor - the descriptor of the method
        Returns:
        the mapped name of the given member
        Throws:
        MappingNotFoundException - if no mapping is found
      • getFieldData

        public FieldData getFieldData​(java.lang.String parent,
                                      java.lang.String name)
                               throws MappingNotFoundException
        Gets the mapped name of a field.
        Parameters:
        parent - the plain internal name of the parent class
        name - the field's plain name
        Returns:
        the mapped name of the requested field
        Throws:
        MappingNotFoundException - if no mapping is found
      • getRawMappings

        public java.util.Map<java.lang.String,​ClassData> getRawMappings()
        Gets the "raw mappings".
        Returns:
        a Map tying each ClassData to the class' plain name
      • getInverted

        public Mapper getInverted()
        Builds a new Mapper that functions in reverse to this one (i.e. one that considers as "mapped" what this one considers plain, and vice versa).
        Returns:
        the inverted mapper