Interface ClassMapping<M extends ClassMapping,P>
-
- Type Parameters:
M- The type of the mappingP- The type of the parent
- All Superinterfaces:
org.cadixdev.bombe.analysis.InheritanceCompletable,Mapping<M,P>,Reversible<M,P>
- All Known Subinterfaces:
InnerClassMapping,TopLevelClassMapping
- All Known Implementing Classes:
AbstractClassMappingImpl,InnerClassMappingImpl,TopLevelClassMappingImpl
public interface ClassMapping<M extends ClassMapping,P> extends Mapping<M,P>, org.cadixdev.bombe.analysis.InheritanceCompletable
Represents a de-obfuscation mapping for classes.- Since:
- 0.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<FieldMapping>computeFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)Attempts to locate a field mapping for the given obfuscated field signature.default FieldMappingcreateFieldMapping(java.lang.String obfuscatedName)Creates a new field mapping, attached to this class mapping, using the given obfuscated name.default FieldMappingcreateFieldMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)Creates a new field mapping, attached to this class mapping, using the given obfuscated and de-obfuscated name.default FieldMappingcreateFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)Creates a new field mapping, attached to this class mapping, using the given obfuscated name.FieldMappingcreateFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature, java.lang.String deobfuscatedName)Creates a new field mapping, attached to this class mapping, using the given signature and de-obfuscated name.default InnerClassMappingcreateInnerClassMapping(java.lang.String obfuscatedName)Creates a new inner class mapping, attached to this class mapping, using the given obfuscated class name.InnerClassMappingcreateInnerClassMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)Creates a new inner class mapping, attached to this class mapping, using the given obfuscated and de-obfuscated class name.default MethodMappingcreateMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)Creates a new method mapping, attached to this class mapping, using the given obfuscated method name and descriptor.default MethodMappingcreateMethodMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.MethodDescriptor obfuscatedDescriptor)Creates a new method mapping, attached to this class mapping, using the given obfuscated method name and descriptor.default MethodMappingcreateMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)Creates a new method mapping, attached to this class mapping, using the given method signature.MethodMappingcreateMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature, java.lang.String deobfuscatedName)Creates a new method mapping, attached to this class mapping, using the given method signature and de-obfuscated name.java.lang.StringgetDeobfuscatedPackage()Gets the de-obfuscated package name of this class mapping.java.util.Optional<FieldMapping>getFieldMapping(java.lang.String obfuscatedName)Gets a field mapping of the given obfuscated name of the class mapping, should it exist.java.util.Optional<FieldMapping>getFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)Gets the field mapping of the given signature of the class mapping, should it exist.java.util.Collection<FieldMapping>getFieldMappings()Gets an immutable collection of all of the field mappings of the class mapping.java.util.Map<java.lang.String,FieldMapping>getFieldsByName()Gets an immutable map of all of the field mappings of the class mapping, by the field name.java.util.Optional<InnerClassMapping>getInnerClassMapping(java.lang.String obfuscatedName)Gets the inner class mapping of the given obfuscated name of the class mapping, should it exist.java.util.Collection<InnerClassMapping>getInnerClassMappings()Gets an immutable collection of all of the inner class mappings of the class mapping.default java.util.Optional<MethodMapping>getMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)Gets the method mapping of the given method signature of the class mapping, should it exist.java.util.Optional<MethodMapping>getMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)Gets the method mapping of the given method signature of the class mapping, should it exist.java.util.Collection<MethodMapping>getMethodMappings()Gets an immutable collection of all of the method mappings of the class mapping.java.lang.StringgetObfuscatedPackage()Gets the obfuscated package name of this class mapping.default FieldMappinggetOrCreateFieldMapping(java.lang.String obfuscatedName)Gets, or creates should it not exist, a field mapping of the given obfuscated name.default FieldMappinggetOrCreateFieldMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)Gets, or creates should it not exist, a field mapping of the given signature.default FieldMappinggetOrCreateFieldMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.FieldType obfuscatedDescriptor)Gets, or creates should it not exist, a field mapping of the given signature.default FieldMappinggetOrCreateFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)Gets, or creates should it not exist, a field mapping of the given signature.default InnerClassMappinggetOrCreateInnerClassMapping(java.lang.String obfuscatedName)Gets, or creates should it not exist, a inner class mapping of the given obfuscated name.default MethodMappinggetOrCreateMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)Gets, or creates should it not exist, a method mapping of the given obfuscated name, and descriptor.default MethodMappinggetOrCreateMethodMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.MethodDescriptor obfuscatedDescriptor)Gets, or creates should it not exist, a method mapping of the given obfuscated name, and descriptor.default MethodMappinggetOrCreateMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)Gets, or creates should it not exist, a method mapping of the given obfuscated signature.java.lang.StringgetSimpleDeobfuscatedName()Gets the unqualified ("simple") de-obfuscated name of the member.java.lang.StringgetSimpleObfuscatedName()Gets the unqualified ("simple") obfuscated name of the member.default booleanhasFieldMapping(java.lang.String obfuscatedName)Establishes whether the class mapping contains a field mapping of the given obfuscated name.booleanhasFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)Establishes whether the class mapping contains a field mapping of the given signature.booleanhasInnerClassMapping(java.lang.String obfuscatedName)Establishes whether the class mapping contains a inner class mapping of the given obfuscated name.default booleanhasMappings()Establishes whether the class mapping has a de-obfuscation mapping, or has some mappings within it.booleanhasMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)Establishes whether the class mapping contains a method mapping of the given obfuscated name.default java.util.Optional<org.cadixdev.bombe.analysis.InheritanceProvider.ClassInfo>provideInheritance(org.cadixdev.bombe.analysis.InheritanceProvider provider, java.lang.Object context)-
Methods inherited from interface org.cadixdev.bombe.analysis.InheritanceCompletable
complete, complete, complete, isComplete
-
Methods inherited from interface org.cadixdev.lorenz.model.Mapping
copy, get, getDeobfuscatedName, getFullDeobfuscatedName, getFullObfuscatedName, getMappings, getObfuscatedName, getOrCreate, hasDeobfuscatedName, merge, set, setDeobfuscatedName
-
Methods inherited from interface org.cadixdev.lorenz.util.Reversible
reverse
-
-
-
-
Method Detail
-
getSimpleObfuscatedName
java.lang.String getSimpleObfuscatedName()
Gets the unqualified ("simple") obfuscated name of the member.- Specified by:
getSimpleObfuscatedNamein interfaceMapping<M extends ClassMapping,P>- Returns:
- The simple obfuscated name
- See Also:
Class.getSimpleName(), Specification
-
getSimpleDeobfuscatedName
java.lang.String getSimpleDeobfuscatedName()
Gets the unqualified ("simple") de-obfuscated name of the member.- Specified by:
getSimpleDeobfuscatedNamein interfaceMapping<M extends ClassMapping,P>- Returns:
- The simple de-obfuscated name
- See Also:
Class.getSimpleName(), Specification
-
getObfuscatedPackage
java.lang.String getObfuscatedPackage()
Gets the obfuscated package name of this class mapping.Default package is represented using an empty string.
- Returns:
- The obfuscated package name
- Since:
- 0.4.0
-
getDeobfuscatedPackage
java.lang.String getDeobfuscatedPackage()
Gets the de-obfuscated package name of this class mapping.Default package is represented using an empty string.
- Returns:
- The de-obfuscated package name
- Since:
- 0.4.0
-
getFieldMappings
java.util.Collection<FieldMapping> getFieldMappings()
Gets an immutable collection of all of the field mappings of the class mapping.- Returns:
- The field mappings
-
getFieldsByName
java.util.Map<java.lang.String,FieldMapping> getFieldsByName()
Gets an immutable map of all of the field mappings of the class mapping, by the field name.- Returns:
- The field mappings by name
- Since:
- 0.4.0
-
getFieldMapping
java.util.Optional<FieldMapping> getFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)
Gets the field mapping of the given signature of the class mapping, should it exist.Note: The field signature is looked up as-is, so if the loaded mappings use field types, looking up a signature without type will fail. Consider using
getFieldMapping(String)orcomputeFieldMapping(FieldSignature).- Parameters:
signature- The signature of the field- Returns:
- The field mapping, wrapped in an
Optional - Since:
- 0.4.0
- See Also:
getFieldMapping(String),computeFieldMapping(FieldSignature)
-
getFieldMapping
java.util.Optional<FieldMapping> getFieldMapping(java.lang.String obfuscatedName)
Gets a field mapping of the given obfuscated name of the class mapping, should it exist. If multiple fields mappings with the same name (but different types) exist, only one of them will be returned.Note: This is not equivalent to calling
getFieldMapping(FieldSignature)with anullfield type. UsecomputeFieldMapping(FieldSignature)to flexibly lookup field signatures with or without type.- Parameters:
obfuscatedName- The obfuscated name of the field mapping- Returns:
- The field mapping, wrapped in an
Optional - See Also:
getFieldMapping(FieldSignature),computeFieldMapping(FieldSignature)
-
computeFieldMapping
java.util.Optional<FieldMapping> computeFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)
Attempts to locate a field mapping for the given obfuscated field signature. UnlikegetFieldMapping(FieldSignature)this method will attempt to match the field signature with or without type:If
FieldSignature.getType()is empty,getFieldMapping(String)is returned. Otherwise, the signature is looked up with type. If that fails, the signature is looked up again without type. Note that it will insert a newFieldMappingwith the specified type for caching purposes.- Parameters:
signature- The (obfuscated) signature of the field- Returns:
- The field mapping, wrapped in an
Optional - See Also:
getFieldMapping(FieldSignature),getFieldMapping(String)
-
createFieldMapping
FieldMapping createFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature, java.lang.String deobfuscatedName)
Creates a new field mapping, attached to this class mapping, using the given signature and de-obfuscated name.- Parameters:
signature- The signature of the fielddeobfuscatedName- The de-obfuscated name of the field- Returns:
- The field mapping
- Since:
- 0.4.0
-
createFieldMapping
default FieldMapping createFieldMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)
Creates a new field mapping, attached to this class mapping, using the given obfuscated and de-obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the fielddeobfuscatedName- The de-obfuscated name of the field- Returns:
- The field mapping
-
createFieldMapping
default FieldMapping createFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)
Creates a new field mapping, attached to this class mapping, using the given obfuscated name.- Parameters:
signature- The signature of the field- Returns:
- The field mapping
- Since:
- 0.4.0
-
createFieldMapping
default FieldMapping createFieldMapping(java.lang.String obfuscatedName)
Creates a new field mapping, attached to this class mapping, using the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the field- Returns:
- The field mapping
-
getOrCreateFieldMapping
default FieldMapping getOrCreateFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)
Gets, or creates should it not exist, a field mapping of the given signature.- Parameters:
signature- The signature of the field mapping- Returns:
- The field mapping
- Since:
- 0.4.0
-
getOrCreateFieldMapping
default FieldMapping getOrCreateFieldMapping(java.lang.String obfuscatedName)
Gets, or creates should it not exist, a field mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the field mapping- Returns:
- The field mapping
-
getOrCreateFieldMapping
default FieldMapping getOrCreateFieldMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)
Gets, or creates should it not exist, a field mapping of the given signature.- Parameters:
obfuscatedName- The obfuscated name of the field mappingobfuscatedDescriptor- The obfuscated descriptor of the field mapping- Returns:
- The field mapping
- Since:
- 0.4.0
-
getOrCreateFieldMapping
default FieldMapping getOrCreateFieldMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.FieldType obfuscatedDescriptor)
Gets, or creates should it not exist, a field mapping of the given signature.- Parameters:
obfuscatedName- The obfuscated name of the field mappingobfuscatedDescriptor- The obfuscated descriptor of the field mapping- Returns:
- The field mapping
- Since:
- 0.5.1
-
hasFieldMapping
boolean hasFieldMapping(org.cadixdev.bombe.type.signature.FieldSignature signature)
Establishes whether the class mapping contains a field mapping of the given signature.- Parameters:
signature- The signature of the field mapping- Returns:
trueshould a field mapping of the given signature exists in the class mapping;falseotherwise- Since:
- 0.4.0
-
hasFieldMapping
default boolean hasFieldMapping(java.lang.String obfuscatedName)
Establishes whether the class mapping contains a field mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the field mapping- Returns:
trueshould a field mapping of the given obfuscated name exists in the class mapping;falseotherwise
-
getMethodMappings
java.util.Collection<MethodMapping> getMethodMappings()
Gets an immutable collection of all of the method mappings of the class mapping.- Returns:
- The method mappings
-
getMethodMapping
java.util.Optional<MethodMapping> getMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)
Gets the method mapping of the given method signature of the class mapping, should it exist.- Parameters:
signature- The signature of the method mapping- Returns:
- The method mapping, wrapped in an
Optional
-
getMethodMapping
default java.util.Optional<MethodMapping> getMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)
Gets the method mapping of the given method signature of the class mapping, should it exist.- Parameters:
obfuscatedName- The obfuscated name of the method mappingobfuscatedDescriptor- The obfuscated descriptor of the method mapping- Returns:
- The method mapping, wrapped in an
Optional - Since:
- 0.5.0
-
createMethodMapping
MethodMapping createMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature, java.lang.String deobfuscatedName)
Creates a new method mapping, attached to this class mapping, using the given method signature and de-obfuscated name.- Parameters:
signature- The method signaturedeobfuscatedName- The de-obfuscated name of the method- Returns:
- The method mapping
-
createMethodMapping
default MethodMapping createMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)
Creates a new method mapping, attached to this class mapping, using the given method signature.- Parameters:
signature- The method signature- Returns:
- The method mapping
-
createMethodMapping
default MethodMapping createMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)
Creates a new method mapping, attached to this class mapping, using the given obfuscated method name and descriptor.- Parameters:
obfuscatedName- The obfuscated method nameobfuscatedDescriptor- The obfuscated method descriptor- Returns:
- The method mapping
-
createMethodMapping
default MethodMapping createMethodMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.MethodDescriptor obfuscatedDescriptor)
Creates a new method mapping, attached to this class mapping, using the given obfuscated method name and descriptor.- Parameters:
obfuscatedName- The obfuscated method nameobfuscatedDescriptor- The obfuscated method descriptor- Returns:
- The method mapping
- Since:
- 0.5.1
-
getOrCreateMethodMapping
default MethodMapping getOrCreateMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)
Gets, or creates should it not exist, a method mapping of the given obfuscated signature.- Parameters:
signature- The signature of the method mapping- Returns:
- The method mapping
-
getOrCreateMethodMapping
default MethodMapping getOrCreateMethodMapping(java.lang.String obfuscatedName, java.lang.String obfuscatedDescriptor)
Gets, or creates should it not exist, a method mapping of the given obfuscated name, and descriptor.- Parameters:
obfuscatedName- The obfuscated name of the method mappingobfuscatedDescriptor- The obfuscated descriptor of the method mapping- Returns:
- The method mapping
-
getOrCreateMethodMapping
default MethodMapping getOrCreateMethodMapping(java.lang.String obfuscatedName, org.cadixdev.bombe.type.MethodDescriptor obfuscatedDescriptor)
Gets, or creates should it not exist, a method mapping of the given obfuscated name, and descriptor.- Parameters:
obfuscatedName- The obfuscated name of the method mappingobfuscatedDescriptor- The obfuscated descriptor of the method mapping- Returns:
- The method mapping
- Since:
- 0.5.1
-
hasMethodMapping
boolean hasMethodMapping(org.cadixdev.bombe.type.signature.MethodSignature signature)
Establishes whether the class mapping contains a method mapping of the given obfuscated name.- Parameters:
signature- The signature of the method mapping- Returns:
trueshould a method mapping of the given obfuscated name exist in the class mapping;falseotherwise
-
getInnerClassMappings
java.util.Collection<InnerClassMapping> getInnerClassMappings()
Gets an immutable collection of all of the inner class mappings of the class mapping.- Returns:
- The inner class mappings
-
getInnerClassMapping
java.util.Optional<InnerClassMapping> getInnerClassMapping(java.lang.String obfuscatedName)
Gets the inner class mapping of the given obfuscated name of the class mapping, should it exist.- Parameters:
obfuscatedName- The obfuscated name of the inner class mapping- Returns:
- The inner class mapping, wrapped in an
Optional
-
createInnerClassMapping
InnerClassMapping createInnerClassMapping(java.lang.String obfuscatedName, java.lang.String deobfuscatedName)
Creates a new inner class mapping, attached to this class mapping, using the given obfuscated and de-obfuscated class name.- Parameters:
obfuscatedName- The obfuscated class namedeobfuscatedName- The de-obfuscated class name- Returns:
- The class mapping
-
createInnerClassMapping
default InnerClassMapping createInnerClassMapping(java.lang.String obfuscatedName)
Creates a new inner class mapping, attached to this class mapping, using the given obfuscated class name.- Parameters:
obfuscatedName- The obfuscated class name- Returns:
- The class mapping
-
getOrCreateInnerClassMapping
default InnerClassMapping getOrCreateInnerClassMapping(java.lang.String obfuscatedName)
Gets, or creates should it not exist, a inner class mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the inner class mapping- Returns:
- The inner class mapping
-
hasInnerClassMapping
boolean hasInnerClassMapping(java.lang.String obfuscatedName)
Establishes whether the class mapping contains a inner class mapping of the given obfuscated name.- Parameters:
obfuscatedName- The obfuscated name of the inner class mapping- Returns:
trueshould a inner class mapping of the given obfuscated name exist in the class mapping;falseotherwise
-
hasMappings
default boolean hasMappings()
Establishes whether the class mapping has a de-obfuscation mapping, or has some mappings within it.- Returns:
trueif the class mappings has mappings;falseotherwise
-
provideInheritance
default java.util.Optional<org.cadixdev.bombe.analysis.InheritanceProvider.ClassInfo> provideInheritance(org.cadixdev.bombe.analysis.InheritanceProvider provider, java.lang.Object context)- Specified by:
provideInheritancein interfaceorg.cadixdev.bombe.analysis.InheritanceCompletable
-
-