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(int api, java.lang.String oldName, java.lang.String newName)Constructs a newSimpleRemapperwith the given mapping.SimpleRemapper(int api, java.util.Map<java.lang.String,java.lang.String> mapping)Constructs a newSimpleRemapperwith the given mapping.SimpleRemapper(java.lang.String oldName, java.lang.String newName)Deprecated.useSimpleRemapper(int, String, String)instead.SimpleRemapper(java.util.Map<java.lang.String,java.lang.String> mapping)Deprecated.useSimpleRemapper(int, Map)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Stringmap(java.lang.String key)Maps the internal name of a class to its new name.java.lang.StringmapAnnotationAttributeName(java.lang.String descriptor, java.lang.String name)Maps an annotation attribute name.java.lang.StringmapBasicInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, java.lang.Object... bootstrapMethodArguments)Maps an invokedynamic or a constant dynamic method name to its new name.java.lang.StringmapFieldName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)Maps a field name to its new name.java.lang.StringmapInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor)Deprecated.java.lang.StringmapMethodName(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, mapInvokeDynamicMethodName, mapMethodDesc, mapModuleName, mapPackageName, mapRecordComponentName, mapSignature, mapType, mapTypes, mapValue, mapWellKnownInvokeDynamicMethodName
-
-
-
-
Constructor Detail
-
SimpleRemapper
@Deprecated(forRemoval=false) public SimpleRemapper(java.util.Map<java.lang.String,java.lang.String> mapping)
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
public SimpleRemapper(int api, java.util.Map<java.lang.String,java.lang.String> mapping)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(forRemoval=false) public SimpleRemapper(java.lang.String oldName, java.lang.String newName)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
public SimpleRemapper(int api, java.lang.String oldName, java.lang.String newName)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 Detail
-
mapMethodName
public java.lang.String mapMethodName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)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
@Deprecated(forRemoval=false) public java.lang.String mapInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor)Deprecated.Maps an invokedynamic or a constant dynamic method name to its new name.- Overrides:
mapInvokeDynamicMethodNamein classRemapper- Parameters:
name- the name of the method.descriptor- the descriptor of the method.- Returns:
- the new name of the method.
-
mapBasicInvokeDynamicMethodName
public java.lang.String mapBasicInvokeDynamicMethodName(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, java.lang.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:
mapBasicInvokeDynamicMethodNamein 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
public java.lang.String mapAnnotationAttributeName(java.lang.String descriptor, java.lang.String name)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
public java.lang.String mapFieldName(java.lang.String owner, java.lang.String name, java.lang.String descriptor)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
public java.lang.String map(java.lang.String key)
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.
-
-