简体   繁体   English

如何在EMF ECORE中为字符串列表建模

[英]How To Model A String List in EMF ECORE

I'm stuck trying to use ecore annotations to model a List for the type attribute I have tried the type="java.lang.String" and type="EString" but both are not getting the results I want. 我一直在尝试使用ecore注释为type属性的列表建模,我尝试过type =“ java.lang.String”和type =“ EString”,但都没有得到我想要的结果。 When using annotations to model a simple String getter/setter it works fine but now I'm stuck using an object holder for a string for string lists and its getting annoying. 当使用注释为简单的String getter / setter建模时,它可以正常工作,但是现在我被卡住了,使用对象持有者来存储字符串列表,这会使字符串变得烦人。 Does anyone have an idea? 有人有主意吗? - Duncan -邓肯

I don't understand why are you using annotations to model a List. 我不明白您为什么要使用批注为列表建模。

To model an attribute as a List of Strings, just define the EType as EString and Upper Bound to -1. 要将属性建模为字符串列表,只需将EType定义为EString并将Upper Bound设置为-1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM