recusive subproperties [message #1802270] |
Tue, 05 February 2019 11:23 |
Eclipse User |
|
|
|
As you can see, the metamodel has a Test, which has properties. These can also have subproperties.

I want now to code a method, which gives back the properties as well as all other subproperties. Here is the naive approach without recursion. Please help me.
public EList<TestProperty> getProperties() {
if (properties == null) {
properties = new EObjectContainmentEList<TestProperty>(TestProperty.class, this,
Iec62264Package.TEST__PROPERTIES);
}
for (TestProperty property : properties) {
properties.add(property.getSubProperties());
}
return properties;
}
|
|
|
Powered by
FUDForum. Page generated in 0.06684 seconds