Class MappingMethod
- java.lang.Object
-
- org.spongepowered.asm.obfuscation.mapping.common.MappingMethod
-
- All Implemented Interfaces:
IMapping<MappingMethod>
public class MappingMethod extends java.lang.Object implements IMapping<MappingMethod>
Stores information about a method mapping during AP runs
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.asm.obfuscation.mapping.IMapping
IMapping.Type
-
-
Constructor Summary
Constructors Constructor Description MappingMethod(java.lang.String fullyQualifiedName, java.lang.String desc)MappingMethod(java.lang.String owner, java.lang.String simpleName, java.lang.String desc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MappingMethodaddPrefix(java.lang.String prefix)Return a clone of this mapping with the supplied prefix added.MappingMethodcopy()Create a clone of this mappingbooleanequals(java.lang.Object obj)java.lang.StringgetDesc()Get the descriptor of this member, for example the method descriptor or field type.java.lang.StringgetName()Get the mapping name, for method mappings this includes the ownerjava.lang.StringgetOwner()Get the owner of this member, for fields and methods this is the class name, for classes it is the package name, for packages it is undefined.java.lang.StringgetSimpleName()Get the base name of this member, for example the bare field, method or class nameMappingMethodgetSuper()Get the next most immediate super-implementation of this mapping.IMapping.TypegetType()Get the mapping type (field, method, class, package)inthashCode()booleanisConstructor()MappingMethodmove(java.lang.String newOwner)Create a clone of this mapping with a new ownerMappingMethodremap(java.lang.String newName)Create a clone of this mapping with a new namejava.lang.Stringserialise()Get a representation of this mapping for serialisation.java.lang.StringtoString()MappingMethodtransform(java.lang.String newDesc)Create a clone of this mapping with a new descriptor
-
-
-
Method Detail
-
getType
public IMapping.Type getType()
Description copied from interface:IMappingGet the mapping type (field, method, class, package)- Specified by:
getTypein interfaceIMapping<MappingMethod>
-
getName
public java.lang.String getName()
Description copied from interface:IMappingGet the mapping name, for method mappings this includes the owner- Specified by:
getNamein interfaceIMapping<MappingMethod>- Returns:
- the mapping name, includes the owner for method mappings
-
getSimpleName
public java.lang.String getSimpleName()
Description copied from interface:IMappingGet the base name of this member, for example the bare field, method or class name- Specified by:
getSimpleNamein interfaceIMapping<MappingMethod>- Returns:
- the base name of this mapping
-
getOwner
public java.lang.String getOwner()
Description copied from interface:IMappingGet the owner of this member, for fields and methods this is the class name, for classes it is the package name, for packages it is undefined. Can return null.- Specified by:
getOwnerin interfaceIMapping<MappingMethod>- Returns:
- the parent of this mapping
-
getDesc
public java.lang.String getDesc()
Description copied from interface:IMappingGet the descriptor of this member, for example the method descriptor or field type. For classes and packages this is undefined. Can return null since not all mapping types support descriptors.- Specified by:
getDescin interfaceIMapping<MappingMethod>- Returns:
- the mapping descriptor
-
getSuper
public MappingMethod getSuper()
Description copied from interface:IMappingGet the next most immediate super-implementation of this mapping. For example if the mapping is a method and the method overrides a method in the immediate superclass, return that method. Can return null if no superclass is available or if no superclass definition exists.- Specified by:
getSuperin interfaceIMapping<MappingMethod>- Returns:
- the method immediately overridden by this method, or null if not present or not resolvable
-
isConstructor
public boolean isConstructor()
-
move
public MappingMethod move(java.lang.String newOwner)
Description copied from interface:IMappingCreate a clone of this mapping with a new owner- Specified by:
movein interfaceIMapping<MappingMethod>- Parameters:
newOwner- new owner- Returns:
- cloned mapping
-
remap
public MappingMethod remap(java.lang.String newName)
Description copied from interface:IMappingCreate a clone of this mapping with a new name- Specified by:
remapin interfaceIMapping<MappingMethod>- Parameters:
newName- new name- Returns:
- cloned mapping
-
transform
public MappingMethod transform(java.lang.String newDesc)
Description copied from interface:IMappingCreate a clone of this mapping with a new descriptor- Specified by:
transformin interfaceIMapping<MappingMethod>- Parameters:
newDesc- new descriptor- Returns:
- cloned mapping
-
copy
public MappingMethod copy()
Description copied from interface:IMappingCreate a clone of this mapping- Specified by:
copyin interfaceIMapping<MappingMethod>- Returns:
- cloned mapping
-
addPrefix
public MappingMethod addPrefix(java.lang.String prefix)
Return a clone of this mapping with the supplied prefix added. Returns this object if the prefix matches the existing name.- Parameters:
prefix- prefix to prepend- Returns:
- cloned mapping
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
serialise
public java.lang.String serialise()
Description copied from interface:IMappingGet a representation of this mapping for serialisation. Individual writers are free to use their own mappings, this method is for convenience only.- Specified by:
serialisein interfaceIMapping<MappingMethod>- Returns:
- string representation of this mapping
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-