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

Bug 327327

Summary: In the tutorial "TypeRef: referenced=[Type] (multi?='*')?;" is not recognized.
Product: [Modeling] TMF Reporter: Philip May <eniak.info>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: eniak.info, jan, sebastian.zarnekow
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Philip May CLA 2010-10-08 07:37:58 EDT
Build Identifier: 

In the Tutorial:
http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html#getting-started-xpand
we write an generator.
The Xpand templates generates getter and setter for each feature.
But the feachure can have a cardinality of "*"
see:
TypeRef:
  referenced=[Type] (multi?='*')?;

This "*" cardinality is not recognized by there generator template cause it always only generates getter and setter...

Reproducible: Always

Steps to Reproduce:
Just do the tutorial and have a look at the generated code.
For example   
entity Speaker extends Person {
    sessions : Session*
  }
Should not just be genetared with getter and setter for Sessions cause sessions is a List.
Comment 1 Philip May CLA 2010-11-08 17:12:45 EST
Are there any solutions to this problem?
Comment 2 Jan Koehnlein CLA 2010-11-09 03:49:27 EST
There are many solutions to implement multi-valued features depending on the usage scenario, e.g. as a list or as an array, mutable or immutable, with add / remove or with a getter for a list etc. Our credo is that users should write their own code generators perfectly fitting their usecases. That's why we focus on creating technology that makes it easy to write code generators instead of delivering "cartridges" matching as many scenarios as possible. 

I guess with the information learned in the tutorial it should be straight forward for users to implement that feature themselves.

We are currently restructuring the infrastructure for the docs and therefore do not fix all documentation bugs individually. We will take this bug into account next time we iterate through the docs. Is that a blocker for you?
Comment 3 Sebastian Zarnekow CLA 2011-11-10 08:32:44 EST
Obsolete since we rewrote the tutorial