本文整理汇总了Java中org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel类的典型用法代码示例。如果您正苦于以下问题:Java EmfRegistryMetaModel类的具体用法?Java EmfRegistryMetaModel怎么用?Java EmfRegistryMetaModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmfRegistryMetaModel类属于org.eclipse.xtend.typesystem.emf包,在下文中一共展示了EmfRegistryMetaModel类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerMetaModels
import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel; //导入依赖的package包/类
/**
* Register the metamodels for this execution context.
*
* @param model
* The model
*/
private void registerMetaModels(final ExportModel model) {
// First, create one meta model that has all the packages that are visible. Use the scope provider to get that list,
// then convert to a list of EPackages.
final EPackage[] ePackages = Lists.newArrayList(Iterables.transform(EObjectUtil.getScopeProviderByEObject(model).getScope(model, ExportPackage.Literals.IMPORT__PACKAGE).getAllElements(), new Function<IEObjectDescription, EPackage>() {
@Override
public EPackage apply(final IEObjectDescription from) {
return (EPackage) EcoreUtil.resolve(from.getEObjectOrProxy(), model);
}
})).toArray(new EPackage[0]);
registerMetaModel(new EmfRegistryMetaModel() {
@Override
public EPackage[] allPackages() {
return ePackages;
}
});
// Finally, add the default meta models
// registerMetaModel(new EmfRegistryMetaModel());
// registerMetaModel(new JavaBeansMetaModel());
}
示例2: registerMetaModels
import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel; //导入依赖的package包/类
/**
* Registers all metamodels accessible to the scope model in the Xtend execution context.
*
* @param model
* scope model to register metamodels for
*/
private void registerMetaModels(final ScopeModel model) {
// First, create one meta model that has all the packages that are visible. Use the scope provider to get that list,
// then convert to a list of EPackages.
final EPackage[] ePackages = Lists.newArrayList(Iterables.transform(EObjectUtil.getScopeProviderByEObject(model).getScope(model, ScopePackage.Literals.IMPORT__PACKAGE).getAllElements(), d -> (EPackage) EcoreUtil.resolve(d.getEObjectOrProxy(), model))).toArray(new EPackage[0]);
registerMetaModel(new EmfRegistryMetaModel() {
@Override
public EPackage[] allPackages() {
return ePackages;
}
});
// Finally, add the default meta models
// registerMetaModel(new EmfRegistryMetaModel());
// registerMetaModel(new JavaBeansMetaModel());
}
示例3: beforeAllTests
import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel; //导入依赖的package包/类
@Override
protected void beforeAllTests() {
super.beforeAllTests();
final ExecutionContextImpl executionContext = new ExecutionContextImpl();
executionContext.registerMetaModel(new JavaBeansMetaModel());
executionContext.registerMetaModel(new EmfRegistryMetaModel());
final CompilationContext context = new CompilationContext(executionContext, new GenModelUtilX());
getTestInformation().putTestObject(CompilerX.class, new CompilerX(context));
}
示例4: getMetamodels
import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel; //导入依赖的package包/类
public MetaModel[] getMetamodels(final IJavaProject project,
final TypeSystem builtin) {
final EPackage[] metamodelsForProject = EmfToolsPlugin.getDefault().getMetamodelsForProject(
project);
return new MetaModel[] { new EmfRegistryMetaModel() {
@Override
protected EPackage[] allPackages() {
return metamodelsForProject;
}
} };
}