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


Java GenModelHelper类代码示例

本文整理汇总了Java中org.eclipse.emf.mwe.utils.GenModelHelper的典型用法代码示例。如果您正苦于以下问题:Java GenModelHelper类的具体用法?Java GenModelHelper怎么用?Java GenModelHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GenModelHelper类属于org.eclipse.emf.mwe.utils包,在下文中一共展示了GenModelHelper类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerReferencedGenModels

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
/**
 * @since 2.0
 */
@Deprecated
protected void registerReferencedGenModels() {
	try {
		if (getReferencedGenModels() != null && getReferencedGenModels().length() > 0) {
			ResourceSet rs = new XtextResourceSet();
			GenModelHelper gmh = new GenModelHelper();
			for (String uriStr : getReferencedGenModels().split(",")) {
				URI uri = URI.createURI(uriStr.trim());
				gmh.registerGenModel(rs, uri);
			}
		}
	} catch (ConfigurationException ce) {
		throw ce;
	} catch (Exception e) {
		log.error(e, e);
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:EcoreGeneratorFragment.java

示例2: getSaveAndReconcileGenModel

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
/**
 * @since 2.0
 */
protected GenModel getSaveAndReconcileGenModel(ResourceSet rs, Grammar grammar, XpandExecutionContext ctx,
		List<EPackage> packs) throws ConfigurationException {
	GenModel genModel = getGenModel(rs, grammar, ctx, packs);
	genModel.initialize(packs);
	for (GenPackage genPackage : genModel.getGenPackages()) {
		genPackage.setBasePackage(getBasePackage(grammar));
		if (isSuppressLoadInitialization()) {
			genPackage.setLoadInitialization(false);
		}
		if (getFileExtensions() != null && packs.contains(genPackage.getEcorePackage())) {
			genPackage.setFileExtensions(getFileExtensions());
		}
	}
	Set<EPackage> referencedEPackages = getReferencedEPackages(packs);
	List<GenPackage> usedGenPackages = getGenPackagesForPackages(genModel, referencedEPackages);
	reconcileMissingGenPackagesInUsedModels(usedGenPackages);
	genModel.getUsedGenPackages().addAll(usedGenPackages);
	try {
		saveResource(genModel.eResource());
	} catch (IOException e) {
		throw new WrappedException(e);
	}
	new GenModelHelper().registerGenModel(genModel);
	return genModel;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:29,代码来源:EMFGeneratorFragment.java

示例3: registerUsedGenModel

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
private void registerUsedGenModel(final URIConverter converter, final Grammar grammar) {
  final URI genModelUri = this.getGenModelUri(grammar);
  boolean _exists = converter.exists(genModelUri, null);
  if (_exists) {
    try {
      GenModelHelper _genModelHelper = new GenModelHelper();
      XtextResourceSet _xtextResourceSet = new XtextResourceSet();
      _genModelHelper.registerGenModel(_xtextResourceSet, genModelUri);
    } catch (final Throwable _t) {
      if (_t instanceof Exception) {
        final Exception e = (Exception)_t;
        EMFGeneratorFragment2.LOG.error("Failed to register GenModel", e);
      } else {
        throw Exceptions.sneakyThrow(_t);
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:19,代码来源:EMFGeneratorFragment2.java

示例4: getSaveAndReconcileGenModel

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
protected GenModel getSaveAndReconcileGenModel(final Grammar grammar, final List<EPackage> packs, final ResourceSet rs) {
  final GenModel genModel = this.getGenModel(rs, grammar);
  genModel.initialize(packs);
  EList<GenPackage> _genPackages = genModel.getGenPackages();
  for (final GenPackage genPackage : _genPackages) {
    {
      genPackage.setBasePackage(this.getBasePackage(grammar));
      if (this.suppressLoadInitialization) {
        genPackage.setLoadInitialization(false);
      }
      if (((!this.getLanguage().getFileExtensions().isEmpty()) && packs.contains(genPackage.getEcorePackage()))) {
        genPackage.setFileExtensions(IterableExtensions.join(this.getLanguage().getFileExtensions(), ","));
      }
    }
  }
  final Set<EPackage> referencedEPackages = this.getReferencedEPackages(packs);
  final List<GenPackage> usedGenPackages = this.getGenPackagesForPackages(genModel, referencedEPackages);
  this.reconcileMissingGenPackagesInUsedModels(usedGenPackages);
  genModel.getUsedGenPackages().addAll(usedGenPackages);
  this.saveResource(genModel.eResource());
  new GenModelHelper().registerGenModel(genModel);
  return genModel;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:24,代码来源:EMFGeneratorFragment2.java

示例5: registerUsedGenModel

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
private void registerUsedGenModel(URIConverter converter) {
	if (genModel == null)
		return;
	URI genModelUri = URI.createURI(genModel);
	genModelUri = toPlatformResourceURI(genModelUri);
	if (converter.exists(genModelUri, null)) {
		try {
			new GenModelHelper().registerGenModel(new XtextResourceSet(), genModelUri);
		} catch (ConfigurationException ce) {
			throw ce;
		} catch (Exception e) {
			log.error(e, e);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:EMFGeneratorFragment.java

示例6: setRegisterGenModelFiles

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
/**
 * Registers the given files in the gen model.
 *
 * @param fileNames
 *          the comma separated file names
 */
public void setRegisterGenModelFiles(final String fileNames) {
  GenModelHelper helper = createGenModelHelper();
  for (URI uri : splitCommaSeparatedString(fileNames)) {
    helper.registerGenModel(resourceSet, uri);
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:13,代码来源:StandaloneSetup.java

示例7: register

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
private void register(final GenModel genModel) {
  new GenModelHelper().registerGenModel(genModel);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:XtextGeneratorResourceSetInitializer.java

示例8: createGenModelHelper

import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
@Override
protected GenModelHelper createGenModelHelper() {
  return new DependencyAwareGenModelHelper();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:5,代码来源:StandaloneSetup.java


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