use of org.eclipse.emf.codegen.ecore.genmodel.GenClass in project xtext-core by eclipse.
the class GenModelUtil2 method getGetAccessor.
public static String getGetAccessor(final GenFeature genFeature, final ResourceSet resourceSet) {
final GenClass genClass = genFeature.getGenClass();
boolean _isMapEntry = genClass.isMapEntry();
if (_isMapEntry) {
GenFeature _mapEntryKeyFeature = genClass.getMapEntryKeyFeature();
boolean _equals = Objects.equal(genFeature, _mapEntryKeyFeature);
if (_equals) {
return "getKey";
}
GenFeature _mapEntryValueFeature = genClass.getMapEntryValueFeature();
boolean _equals_1 = Objects.equal(genFeature, _mapEntryValueFeature);
if (_equals_1) {
return "getValue";
}
}
return genFeature.getGetAccessor();
}
use of org.eclipse.emf.codegen.ecore.genmodel.GenClass in project xtext-core by eclipse.
the class GenModelUtil2 method getGenFeature.
public static GenFeature getGenFeature(final EStructuralFeature feature, final ResourceSet resourceSet) {
GenClassifier _genClassifier = GenModelUtil2.getGenClassifier(feature.getEContainingClass(), resourceSet);
final GenClass genCls = ((GenClass) _genClassifier);
EList<GenFeature> _genFeatures = genCls.getGenFeatures();
for (final GenFeature genFeat : _genFeatures) {
String _name = feature.getName();
String _name_1 = genFeat.getEcoreFeature().getName();
boolean _equals = Objects.equal(_name, _name_1);
if (_equals) {
return genFeat;
}
}
StringConcatenation _builder = new StringConcatenation();
_builder.append("No GenFeature named \'");
String _name_2 = feature.getName();
_builder.append(_name_2);
_builder.append("\' found in GenClass \'");
_builder.append(genCls);
_builder.append("\' from GenModel");
URI _uRI = genCls.eResource().getURI();
_builder.append(_uRI);
throw new RuntimeException(_builder.toString());
}
Aggregations