本文整理汇总了Java中org.eclipse.emf.codegen.ecore.genmodel.GenFeature类的典型用法代码示例。如果您正苦于以下问题:Java GenFeature类的具体用法?Java GenFeature怎么用?Java GenFeature使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenFeature类属于org.eclipse.emf.codegen.ecore.genmodel包,在下文中一共展示了GenFeature类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGenFeature
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
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());
}
示例2: getGetAccessor
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
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();
}
示例3: getGenFeature
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
public static GenFeature getGenFeature(EStructuralFeature feature, ResourceSet resourceSet) {
GenClass genCls = (GenClass) getGenClassifier(feature.getEContainingClass(), resourceSet);
for (GenFeature genFeat : genCls.getGenFeatures())
if (feature.getName().equals(genFeat.getEcoreFeature().getName())) {
return genFeat;
}
throw new RuntimeException("No GenFeature named '" + feature.getName() + "' found in GenClass '" + genCls
+ "' from GenModel" + genCls.eResource().getURI());
}
示例4: getGenTypeLiteral
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
public static String getGenTypeLiteral(EStructuralFeature feature, ResourceSet resourceSet) {
// inspired by org.eclipse.emf.codegen.ecore.genmodel.impl.GenFeatureImpl.getQualifiedFeatureAccessor()
GenFeature genFeature = getGenFeature(feature, resourceSet);
String pkg = genFeature.getGenPackage().getPackageInterfaceName();
if (genFeature.getGenPackage().isLiteralsInterface())
return pkg + ".Literals." + genFeature.getGenClass().getFeatureID(genFeature);
else
return pkg + ".eINSTANCE.get" + genFeature.getFeatureAccessorName() + "()";
}
示例5: getGetAccessor
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
public String getGetAccessor(EStructuralFeature feature) {
GenFeature genFeature = GenModelAccess.getGenFeature(feature, resourceSet);
GenClass genClass = genFeature.getGenClass();
if (genClass.isMapEntry()) {
if (genFeature == genClass.getMapEntryKeyFeature())
return "getKey";
if (genFeature == genClass.getMapEntryValueFeature())
return "getValue";
}
return genFeature.getGetAccessor();
}
示例6: getFeatureLiteral
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
public static String getFeatureLiteral(final GenFeature genFeature, final ResourceSet resourceSet) {
boolean _isLiteralsInterface = genFeature.getGenPackage().isLiteralsInterface();
if (_isLiteralsInterface) {
String _featureID = genFeature.getGenClass().getFeatureID(genFeature);
return ("Literals." + _featureID);
} else {
String _featureAccessorName = genFeature.getFeatureAccessorName();
String _plus = ("eINSTANCE.get" + _featureAccessorName);
return (_plus + "()");
}
}
示例7: getGenIntLiteral
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
public static String getGenIntLiteral(EClass clazz, EStructuralFeature feature, ResourceSet resourceSet) {
GenFeature genFeature = getGenFeature(feature, resourceSet);
GenClass genClass = getGenClass(clazz, resourceSet);
return genClass.getGenPackage().getPackageInterfaceName() + "." + genClass.getFeatureID(genFeature);
}
示例8: getListConstructor
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
@Override
public String getListConstructor(final GenFeature genFeature) {
return GMATransform.replaceDevName(this, super.getListConstructor(genFeature));
}
示例9: createGenFeature
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
@Override
public GenFeature createGenFeature() {
return new GMAGenFeatureImpl();
}