Method names can be changed using the --mapping flag, which takes a properties file with the
mappings to use. Each method mapping is defined with the full Java method signature for the key, and
an Objective-C selector value. For example, the line to map Object.equals() to NSObject.isEqual:
is:
The left hand declaration is the full method signature, as defined by the Java Virtual Machine
Specification. The right
hand definition consists of the iOS selector (i.e. what you would pass to @selector()).
The method and its mapping must have the same number of parameters.
As another example, this line is equivalent to the example in the previous section:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["The `@ObjectiveCName` annotation allows developers to rename Java methods and their overrides within the translated Objective-C code."],["Method renaming can also be accomplished using mapping files specified with the `--mapping` flag during translation, providing an alternative to annotations."],["Mapping files utilize a key-value structure where the key is the Java method signature and the value is the desired Objective-C selector, ensuring both have the same parameter count."]]],["The `@ObjectiveCName` annotation renames Java methods in their Objective-C translation. The annotation's string value defines the desired Objective-C selector, excluding parameter types and names. Alternatively, the `--mapping` flag utilizes a properties file to map Java method signatures to Objective-C selectors. Each mapping specifies the full Java method signature on the left and the Objective-C selector on the right. Multiple mapping files can be provided. Mapped methods must have the same number of parameters.\n"]]