當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。