@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Property
native modifier. Property methods must not be
static.
Property methods in ordinary classes can have any name if a
selector() has been specified. The property getter must return
something and take 0 parameters and the setter must return nothing and take
exactly 1 parameter.
Property methods in extension classes (extending NSExtensions or
ObjCExtensions must be static and take an instance of the
target class as first parameter.
If no selector() has been specified the name of
the method will be used to determine the selector for the property. In that
case the property methods must follow the Java beans property methods
naming convention: the getter name starts with "is" or "get" while the
setter name starts with "set".
| Modifier and Type | Optional Element and Description |
|---|---|
String |
name
The name of the property.
|
String |
selector
The name of the Objective-C selector this property getter or setter binds
to.
|
boolean |
strongRef
Specifies that when a property is set a strong reference from the
Objective-C object the property belongs to to the Java instance being set
should be created.
|
public abstract String selector
public abstract String name
public abstract boolean strongRef
assign or weak in Objective-C).
This attribute is only meaningful when set on a setter method. If specified on a getter method it will be ignored.
NOTE: There must be a corresponding getter method in the class. This will
be used to determine the old value of the property.
ObjCObject.removeStrongRef(Object) will be called passing the old
value if not null. If the property methods follow the Java beans
naming convention the getter method can be automatically determined.
Otherwise the name() has to be set to the same value on both
the getter and setter methods.
Copyright © 2012-2015 RoboVM AB. All Rights Reserved.