本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例7: register
import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
private void register(final GenModel genModel) {
new GenModelHelper().registerGenModel(genModel);
}
示例8: createGenModelHelper
import org.eclipse.emf.mwe.utils.GenModelHelper; //导入依赖的package包/类
@Override
protected GenModelHelper createGenModelHelper() {
return new DependencyAwareGenModelHelper();
}