DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Generating Array Accessors in EMF

Generating Array Accessors in EMF

Annamalai Chockalingam user avatar by
Annamalai Chockalingam
·
Oct. 20, 08 · Java Zone · Interview
Like (0)
Save
Tweet
5.80K Views

Join the DZone community and get the full member experience.

Join For Free

Have you ever tried to generate References or variable with multiplicity more than 1? Eclipse being an OOPs follower would always generate a List containing a list of References or Datatypes. But if you are an Array Lover, How do you generate an Array Accessor for 0..* References or 0..* Variables.

There is a hidden variable in EMF that lets you customise ur code generator to generate Array Accessors for all list.

Now where do you find this ... 

1. Select the Root Package of your model in your GENMODEL File.

2. Look in the properties and scroll to the MODEL Section.

3. 1st Property would be Array Accessors. It would be initialised to False by default, Change it to True.

Refer to Figure below :: 

[img_assist|nid=5574|title=|desc=|link=popup|align=center|width=418|height=115]

Now you are all set to generate code. All the generated code would result in Array Accessors wherever we would expect a List.

Thats a quicky. Try it out !

 

Eclipse Modeling Framework Data structure

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Evolution of Configuration Management: IaC vs. GitOps
  • How to Optimize MySQL Queries for Speed and Performance
  • Role of Development Team in an Agile Environment
  • Stupid Things Orgs Do That Kill Productivity w/ Netflix, FloSports & Refactoring.club

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo