Package com.google.j2objc.annotations
Annotation Type ObjectiveCAdapterMethod
Annotation applicable to methods that generates a peer "adapter" method in the transpiled class
or interface. Adapter methods can provide one or more "adaptations" to the generated method,
which change the types and behavior of the annotated ("adapted") method.
Adapter methods are intended to reduce friction between native and J2ObjC interfaces, and improve type information and safety. For example, using the EXCEPTIONS_AS_ERRORS adaptation allows Java methods that throw exceptions to be safely called from Objective-C and Swift without needing to catch exceptions in Objective-C (exceptions cannot be caught in Swift).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Specific adaptations applied by the annotation. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionList of adaptations the adapter method will use.The Objective-C selector to use for the adapter method.
-
Element Details
-
selector
String selectorThe Objective-C selector to use for the adapter method. Has the same naming requirements as the ObjectiveCName annotation for methods. This field is required.- Default:
""
-
adaptations
ObjectiveCAdapterMethod.Adaptation[] adaptationsList of adaptations the adapter method will use.- Default:
{}
-