类 SimpleRemapper

java.lang.Object
cn.taketoday.bytecode.commons.Remapper
cn.taketoday.bytecode.commons.SimpleRemapper

public class SimpleRemapper extends Remapper
A Remapper using a Map to define its mapping.
作者:
Eugene Kuleshov
  • 构造器详细资料

    • SimpleRemapper

      public SimpleRemapper(Map<String,String> mapping)
      Constructs a new SimpleRemapper with the given mapping.
      参数:
      mapping - a map specifying a remapping as follows:
      • for method names, the key is the owner, name and descriptor of the method (in the form <owner>.<name><descriptor>), and the value is the new method name.
      • for invokedynamic method names, the key is the name and descriptor of the method (in the form .<name><descriptor>), and the value is the new method name.
      • for field and attribute names, the key is the owner and name of the field or attribute (in the form <owner>.<name>), and the value is the new field name.
      • for internal names, the key is the old internal name, and the value is the new internal name.
    • SimpleRemapper

      public SimpleRemapper(String oldName, String newName)
      Constructs a new SimpleRemapper with the given mapping.
      参数:
      oldName - the key corresponding to a method, field or internal name (see SimpleRemapper(Map) for the format of these keys).
      newName - the new method, field or internal name.
  • 方法详细资料

    • mapMethodName

      public String mapMethodName(String owner, String name, String descriptor)
      从类复制的说明: Remapper
      Maps a method name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
      覆盖:
      mapMethodName 在类中 Remapper
      参数:
      owner - the internal name of the owner class of the method.
      name - the name of the method.
      descriptor - the descriptor of the method.
      返回:
      the new name of the method.
    • mapInvokeDynamicMethodName

      public String mapInvokeDynamicMethodName(String name, String descriptor)
      从类复制的说明: Remapper
      Maps an invokedynamic or a constant dynamic method name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
      覆盖:
      mapInvokeDynamicMethodName 在类中 Remapper
      参数:
      name - the name of the method.
      descriptor - the descriptor of the method.
      返回:
      the new name of the method.
    • mapAnnotationAttributeName

      public String mapAnnotationAttributeName(String descriptor, String name)
      从类复制的说明: Remapper
      Maps an annotation attribute name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
      覆盖:
      mapAnnotationAttributeName 在类中 Remapper
      参数:
      descriptor - the descriptor of the annotation class.
      name - the name of the annotation attribute.
      返回:
      the new name of the annotation attribute.
    • mapFieldName

      public String mapFieldName(String owner, String name, String descriptor)
      从类复制的说明: Remapper
      Maps a field name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
      覆盖:
      mapFieldName 在类中 Remapper
      参数:
      owner - the internal name of the owner class of the field.
      name - the name of the field.
      descriptor - the descriptor of the field.
      返回:
      the new name of the field.
    • map

      public String map(String key)
      从类复制的说明: Remapper
      Maps the internal name of a class to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
      覆盖:
      map 在类中 Remapper
      参数:
      key - the internal name of a class.
      返回:
      the new internal name.