Package org.objectweb.asm.commons
Class SimpleRemapper
- java.lang.Object
-
- org.objectweb.asm.commons.Remapper
-
- org.objectweb.asm.commons.SimpleRemapper
-
-
Constructor Summary
Constructors Constructor Description SimpleRemapper(java.lang.String oldName, java.lang.String newName)
Constructs a newSimpleRemapper
with the given mapping.SimpleRemapper(java.util.Map<java.lang.String,java.lang.String> mapping)
Constructs a newSimpleRemapper
with the given mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
map(java.lang.String key)
Maps the internal name of a class to its new name.java.lang.String
mapAnnotationAttributeName(java.lang.String descriptor, java.lang.String name)
Maps an annotation attribute name.java.lang.String
mapFieldName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Maps a field name to its new name.java.lang.String
mapInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor)
Maps an invokedynamic or a constant dynamic method name to its new name.java.lang.String
mapMethodName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Maps a method name to its new name.-
Methods inherited from class org.objectweb.asm.commons.Remapper
createRemappingSignatureAdapter, createSignatureRemapper, mapDesc, mapInnerClassName, mapMethodDesc, mapModuleName, mapPackageName, mapRecordComponentName, mapSignature, mapType, mapTypes, mapValue
-
-
-
-
Constructor Detail
-
SimpleRemapper
public SimpleRemapper(java.util.Map<java.lang.String,java.lang.String> mapping)
Constructs a newSimpleRemapper
with the given mapping.- Parameters:
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(java.lang.String oldName, java.lang.String newName)
Constructs a newSimpleRemapper
with the given mapping.- Parameters:
oldName
- the key corresponding to a method, field or internal name (seeSimpleRemapper(Map)
for the format of these keys).newName
- the new method, field or internal name.
-
-
Method Detail
-
mapMethodName
public java.lang.String mapMethodName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Description copied from class:Remapper
Maps a method name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapMethodName
in classRemapper
- Parameters:
owner
- the internal name of the owner class of the method.name
- the name of the method.descriptor
- the descriptor of the method.- Returns:
- the new name of the method.
-
mapInvokeDynamicMethodName
public java.lang.String mapInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor)
Description copied from class: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.- Overrides:
mapInvokeDynamicMethodName
in classRemapper
- Parameters:
name
- the name of the method.descriptor
- the descriptor of the method.- Returns:
- the new name of the method.
-
mapAnnotationAttributeName
public java.lang.String mapAnnotationAttributeName(java.lang.String descriptor, java.lang.String name)
Description copied from class:Remapper
Maps an annotation attribute name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapAnnotationAttributeName
in classRemapper
- Parameters:
descriptor
- the descriptor of the annotation class.name
- the name of the annotation attribute.- Returns:
- the new name of the annotation attribute.
-
mapFieldName
public java.lang.String mapFieldName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Description copied from class:Remapper
Maps a field name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapFieldName
in classRemapper
- Parameters:
owner
- the internal name of the owner class of the field.name
- the name of the field.descriptor
- the descriptor of the field.- Returns:
- the new name of the field.
-
map
public java.lang.String map(java.lang.String key)
Description copied from class: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.
-
-