use of org.yakindu.sct.model.sgen.FeatureParameter in project statecharts by Yakindu.
the class AbstractJavaGeneratorTest method createGeneratorEntry.
private GeneratorEntry createGeneratorEntry(String targetProject, String targetFolder) {
GeneratorEntry entry = SGenFactory.eINSTANCE.createGeneratorEntry();
entry.setContentType(CONTENT_TYPE);
FeatureConfiguration config = SGenFactory.eINSTANCE.createFeatureConfiguration();
FeatureType type = SGenFactory.eINSTANCE.createFeatureType();
type.setName(OUTLET_FEATURE);
config.setType(type);
FeatureParameterValue project = SGenFactory.eINSTANCE.createFeatureParameterValue();
FeatureParameter projectParameter = SGenFactory.eINSTANCE.createFeatureParameter();
projectParameter.setName(TARGET_PROJECT);
project.setParameter(projectParameter);
project.setValue(targetProject);
config.getParameterValues().add(project);
FeatureParameterValue targetFolderValue = SGenFactory.eINSTANCE.createFeatureParameterValue();
FeatureParameter targetParameter = SGenFactory.eINSTANCE.createFeatureParameter();
targetParameter.setName(TARGET_FOLDER);
targetFolderValue.setParameter(targetParameter);
targetFolderValue.setValue(targetFolder);
config.getParameterValues().add(targetFolderValue);
entry.getFeatures().add(config);
return entry;
}
use of org.yakindu.sct.model.sgen.FeatureParameter in project statecharts by Yakindu.
the class FeatureResourceDescription method computeExportedObjects.
@Override
protected List<IEObjectDescription> computeExportedObjects() {
Iterator<EObject> contents = resource.getAllContents();
List<IEObjectDescription> result = Lists.newArrayList();
while (contents.hasNext()) {
EObject eObject = contents.next();
QualifiedName qualifiedName = qualifiedNameProvider.apply(eObject);
if (qualifiedName != null) {
Map<String, String> userData = new HashMap<String, String>();
if (eObject instanceof FeatureParameter) {
userData.put(FEATURE_CONTAINER, getFqName(eObject));
}
result.add(new EObjectDescription(qualifiedName, eObject, userData));
}
}
return result;
}
use of org.yakindu.sct.model.sgen.FeatureParameter in project statecharts by Yakindu.
the class AbstractDefaultFeatureValueProvider method createDefaultFeatureConfiguration.
public final FeatureConfiguration createDefaultFeatureConfiguration(FeatureType type, EObject contextElement) {
FeatureConfiguration config = createConfiguration(type);
EList<FeatureParameter> parameters = type.getParameters();
for (FeatureParameter parameter : parameters) {
FeatureParameterValue parameterValue = createParameterValue(type, parameter, contextElement);
if (parameterValue != null && parameterValue.getExpression() != null) {
config.getParameterValues().add(parameterValue);
}
}
return config;
}
use of org.yakindu.sct.model.sgen.FeatureParameter in project statecharts by Yakindu.
the class HelpIntegrationTest method checkDocumentedFeaturesExist.
@Test
public void checkDocumentedFeaturesExist() {
List<String> features = getDocumentedFeatures();
ArrayList<String> generators = new ArrayList<String>(Arrays.asList(YAKINDU_JAVA, YAKINDU_C, YAKINDU_CPP, YAKINDU_GENERIC));
for (String generator : generators) {
Iterable<IEObjectDescription> allElements = getAllElements(generator);
for (IEObjectDescription desc : allElements) {
if (desc.getEClass() != SGenPackage.Literals.FEATURE_TYPE)
continue;
EObject o = desc.getEObjectOrProxy();
String name = null;
if (o instanceof FeatureConfiguration) {
FeatureType type = ((FeatureConfiguration) o).getType();
if (type != null) {
name = type.getName();
}
} else if (o instanceof FeatureType) {
FeatureType type = (FeatureType) o;
if (type != null) {
name = type.getName();
}
} else if (o instanceof FeatureParameter) {
FeatureType type = ((FeatureParameter) o).getFeatureType();
if (type != null) {
name = type.getName();
}
}
if (name != null)
name = name.toLowerCase();
if (name != null && features.contains(name)) {
features.remove(name);
}
}
}
if (features.size() > 0) {
fail("There are documented features that are not implemented: " + Arrays.toString(features.toArray()));
}
}
use of org.yakindu.sct.model.sgen.FeatureParameter in project statecharts by Yakindu.
the class FeatureParameterValueImpl method setParameter.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setParameter(FeatureParameter newParameter) {
FeatureParameter oldParameter = parameter;
parameter = newParameter;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SGenPackage.FEATURE_PARAMETER_VALUE__PARAMETER, oldParameter, parameter));
}
Aggregations