
org.jnario.feature.jvmmodel.VisibleMembersCalculator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jnario.standalone Show documentation
Show all versions of org.jnario.standalone Show documentation
The required libraries to execute Jnario specifications without Eclipse.
The newest version!
package org.jnario.feature.jvmmodel;
import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtend.core.xtend.XtendMember;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.jnario.feature.feature.Background;
import org.jnario.feature.feature.Feature;
import org.jnario.feature.feature.Scenario;
import org.jnario.feature.feature.Step;
@SuppressWarnings("all")
public class VisibleMembersCalculator {
public Iterable allVisibleMembers(final Step step) {
Iterable _xblockexpression = null;
{
final Scenario scenario = EcoreUtil2.getContainerOfType(step, Scenario.class);
boolean _equals = Objects.equal(scenario, null);
if (_equals) {
return CollectionLiterals.emptyList();
}
_xblockexpression = this.allVisibleMembers(scenario);
}
return _xblockexpression;
}
public Iterable allVisibleMembers(final Scenario scenario) {
EList members = scenario.getMembers();
if ((scenario instanceof Background)) {
return members;
}
final Feature feature = EcoreUtil2.getContainerOfType(scenario, Feature.class);
Background _background = feature.getBackground();
boolean _equals = Objects.equal(_background, null);
if (_equals) {
return members;
}
Background _background_1 = feature.getBackground();
EList _members = _background_1.getMembers();
return Iterables.concat(members, _members);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy