com.google.j2objc.annotations
Stay organized with collections
Save and categorize content based on your preferences.
Annotations
AutoreleasePool |
Annotation that indicates the translator should inject an autorelease pool
around the method body. |
J2ObjCIncompatible |
Marks a declaration to be stripped by the J2ObjC translator prior to
compilation. |
LoopTranslation |
Annotation that specifies how an enhanced for loop should be translated by
the J2ObjC translator. |
ObjectiveCName |
Annotation that specifies what the Objective-C class, protocol, method,
constructor or package declaration should be when translated. |
OnDealloc |
Annotates a method which will be called from "- (void)dealloc" method in the transpiled ObjC
code. |
Property |
Adds property declarations to generated Objective-C for annotated fields. |
ReflectionSupport |
Annotation that specifies the level of reflection support for a particular
class. |
RetainedLocalRef |
Annotation that indicates a local variable should be retained outside of any
subsequent AutoreleasePool use. |
RetainedWith |
PLEASE READ THIS DOCUMENTATION BEFORE USING THIS ANNOTATION!
Note the criteria listed below which cannot be enforced by static analysis
in j2objc. |
Weak |
Annotation that indicates a variable has a weak relationship to its owner. |
WeakOuter |
Annotation that indicates an inner class has a weak relationship to its owning class. |
Enums
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["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."],[[["J2ObjC annotations provide developers with fine-grained control over the translation process from Java to Objective-C."],["These annotations cover various aspects, including memory management, reflection support, and Objective-C name mapping."],["Developers can influence how specific language constructs, such as enhanced for loops, are translated using these annotations."],["Some annotations, like `RetainedWith`, require careful consideration due to potential runtime implications and limitations of static analysis."],["Annotations such as `Weak` and `WeakOuter` allow for managing object relationships and memory efficiently in the translated Objective-C code."]]],["The content outlines various annotations and enums used by the J2ObjC translator. Annotations specify how Java code is translated to Objective-C. Key actions include: injecting autorelease pools, stripping declarations, defining loop translation, renaming Objective-C elements, triggering methods on deallocation, adding property declarations, controlling reflection support, retaining local variables, defining weak relationships. Enums define options for loop translation and levels of reflection support.\n"]]