Package org.objectweb.asm.commons
Class SimpleRemapper
java.lang.Object
org.objectweb.asm.commons.Remapper
org.objectweb.asm.commons.SimpleRemapper
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleRemapper(int api, String oldName, String newName) Constructs a newSimpleRemapperwith the given mapping.SimpleRemapper(int api, Map<String, String> mapping) Constructs a newSimpleRemapperwith the given mapping.SimpleRemapper(String oldName, String newName) Deprecated.SimpleRemapper(Map<String, String> mapping) Deprecated.useSimpleRemapper(int, Map)instead. -
Method Summary
Modifier and TypeMethodDescriptionMaps the internal name of a class to its new name.mapAnnotationAttributeName(String descriptor, String name) Maps an annotation attribute name.mapFieldName(String owner, String name, String descriptor) Maps a field name to its new name.mapInvokeDynamicMethodName(String name, String descriptor) Maps an invokedynamic or a constant dynamic method name to its new name.mapInvokeDynamicMethodName(String name, String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) Maps an invokedynamic or a constant dynamic method name to its new name.mapMethodName(String owner, String name, 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 Details
-
SimpleRemapper
Deprecated.useSimpleRemapper(int, Map)instead.Constructs a newSimpleRemapperwith 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 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 attribute names, the key is the annotation descriptor and the name of the attribute (in the form <descriptor>.<name>), and the value is the new attribute name.
- for internal names, the key is the old internal name, and the value is the new
internal name (see
Type.getInternalName()).
-
SimpleRemapper
Constructs a newSimpleRemapperwith the given mapping.- Parameters:
api- the ASM API version supported by this remapper. Must be one of theASMx values inOpcodes.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 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 attribute names, the key is the annotation descriptor and the name of the attribute (in the form <descriptor>.<name>), and the value is the new attribute name.
- for internal names, the key is the old internal name, and the value is the new
internal name (see
Type.getInternalName()).
-
SimpleRemapper
Deprecated.useSimpleRemapper(int, String, String)instead.Constructs a newSimpleRemapperwith 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 (seeType.getInternalName()).
-
SimpleRemapper
Constructs a newSimpleRemapperwith the given mapping.- Parameters:
api- the ASM API version supported by this remapper. Must be one of theASMx values inOpcodes.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 (seeType.getInternalName()).
-
-
Method Details
-
mapMethodName
Description copied from class:RemapperMaps a method name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapMethodNamein classRemapper- Parameters:
owner- the internal name of the owner class of the method (seeType.getInternalName()).name- the name of the method.descriptor- the descriptor of the method.- Returns:
- the new name of the method.
-
mapInvokeDynamicMethodName
Description copied from class:RemapperMaps 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:
mapInvokeDynamicMethodNamein classRemapper- Parameters:
name- the name of the method.descriptor- the descriptor of the method.- Returns:
- the new name of the method.
-
mapInvokeDynamicMethodName
public String mapInvokeDynamicMethodName(String name, String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) Description copied from class:RemapperMaps 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:
mapInvokeDynamicMethodNamein classRemapper- Parameters:
name- the name of the method.descriptor- the descriptor of the method.bootstrapMethodHandle- the bootstrap method.bootstrapMethodArguments- the bootstrap method constant arguments. Each argument must be anInteger,Float,Long,Double,String,Type,HandleorConstantDynamicvalue. This method is allowed to modify the content of the array so a caller should expect that this array may change.- Returns:
- the new name of the method.
-
mapAnnotationAttributeName
Description copied from class:RemapperMaps an annotation attribute name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapAnnotationAttributeNamein 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
Description copied from class:RemapperMaps a field name to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.- Overrides:
mapFieldNamein classRemapper- Parameters:
owner- the internal name of the owner class of the field (seeType.getInternalName()).name- the name of the field.descriptor- the descriptor of the field.- Returns:
- the new name of the field.
-
map
Description copied from class:RemapperMaps the internal name of a class to its new name. The default implementation of this method returns the given name, unchanged. Subclasses can override.
-
SimpleRemapper(int, String, String)instead.