Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363018

Summary: [Xtend] support for property declaration
Product: [Tools] Xtend Reporter: Sven Efftinge <sven.efftinge>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jan, stevemash
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 373184    
Bug Blocks:    

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.