Module org.eclipse.xtend.lib
Annotation Interface Accessors
Creates getters and setters for annotated fields or for all fields in an annotated class.
Annotated on a field
- Creates a getter for that field if none exists. For primitive boolean properties, the "is"-prefix is used.
- Creates a setter for that field if it is not final and no setter exists
- By default the accessors are public
- If the
AccessorType[] argument is given, only the listed accessors with the specified visibility will be generated - By default the accessors will be deprecated if the field is annotated as such.
This can be changed by explicitly providing
deprecationPolicy
Annotated on a class
- Creates accessors for all non-static fields of that class as specified above
- Creates a constructor taking all final fields of the class if no
constructor exists yet. If there already is a constructor and you want the
default one on top of that, you can use the
FinalFieldsConstructorannotation.
AccessorType.NONE.
This annotation can also be used to fine-tune the getters generated by Data.- Since:
- 2.7
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDescribes when@Deprecatedwill be added to generated accessors.
If it is not wanted or needed, passAccessorsDeprecationPolicy.NEVERto prevent the annotation from being added.Describes the access modifiers for generated accessors.
-
Element Details
-
value
AccessorType[] valueDescribes the access modifiers for generated accessors. Valid combinations include at most one type for getters and one for setters. Accessors may be suppressed by passingAccessorType.NONE.- Default:
{PUBLIC_GETTER, PUBLIC_SETTER}
-
deprecationPolicy
Describes when@Deprecatedwill be added to generated accessors.
If it is not wanted or needed, passAccessorsDeprecationPolicy.NEVERto prevent the annotation from being added.- Since:
- 2.23
- Default:
SAME_AS_FIELD
-