Page Summary
-
The
@Propertyannotation facilitates the creation of Objective-C property declarations from annotated Java fields, mirroring Apple's@propertyfunctionality. -
Default attributes like
readwrite,strong(with ARC), andatomicare automatically applied and thus omitted from the annotation. -
Strings inherently receive the
copyattribute for proper memory management in Objective-C. -
Utilizing the
valuemethod within the annotation enables developers to specify custom attributes likecopyandnonatomicfor fine-grained control over the generated property declaration. -
Errors are generated during compilation if invalid attributes are included within the annotation, ensuring code correctness.
Adds property declarations to generated Objective-C for annotated fields. See Apple's @property documentation.
Notes:
- Invalid attributes are reported as errors.
- readwrite, strong (when using ARC), and atomic attributes are removed since they are defaults.
- Strings will include the copy attribute.
class Foo {
@Property("copy, nonatomic") protected String bar;
}@property (copy, nonatomic) NSString *bar;
Public Method Summary
| String |
value()
|