Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363018 - [Xtend] support for property declaration
Summary: [Xtend] support for property declaration
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 373184
Blocks:
  Show dependency tree
 
Reported: 2011-11-07 02:34 EST by Sven Efftinge CLA
Modified: 2017-10-31 11:25 EDT (History)
2 users (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2011-11-07 02:34:56 EST
adding a keyword ('property'?) in front of a field declaration will automatically result in a getter and setter method. 
The default visibility of them will be public. but can be specified if different. the Java field will always be private. 
A setter or getter is only generated if such a method doesn't already exist, i.e. wasn't declared explicitly.
Comment 1 Sven Efftinge CLA 2012-03-08 03:12:46 EST
MAybe we want to solve this with bug #373184
Comment 2 Sven Efftinge CLA 2012-04-19 07:29:20 EDT
If a field is annotated with @org.eclipse.xtend.lib.Property a getter is generated if it doesn't exist.
A setter is generated if the field is not a final field.
The field is renamed to _<fieldName> so that references to fieldName are bound to the getter and the setter within the class.
Comment 3 Sven Efftinge CLA 2012-04-19 09:36:33 EDT
pushed to master
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:25:05 EDT
Requested via bug 522520.

-M.