本文整理匯總了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();
}