当前位置: 首页>>代码示例>>Java>>正文


Java GenFeature类代码示例

本文整理汇总了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());
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:24,代码来源:GenModelUtil2.java

示例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();
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:18,代码来源:GenModelUtil2.java

示例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());
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:GenModelAccess.java

示例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() + "()";
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:GenModelAccess.java

示例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();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:JavaEMFFile.java

示例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 + "()");
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:12,代码来源:GenModelUtil2.java

示例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);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:6,代码来源:GenModelAccess.java

示例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));
}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:5,代码来源:GMAGenClassImpl.java

示例9: createGenFeature

import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; //导入依赖的package包/类
@Override
public GenFeature createGenFeature() {
  return new GMAGenFeatureImpl();
}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:5,代码来源:GMAFactoryImpl.java


注:本文中的org.eclipse.emf.codegen.ecore.genmodel.GenFeature类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。