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


Java EmfRegistryMetaModel类代码示例

本文整理汇总了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());
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:26,代码来源:ExportGeneratorSupport.java

示例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());
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:ScopingGeneratorUtil.java

示例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));
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:10,代码来源:CodeGenerationXTest.java

示例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;
		}
	} };
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:12,代码来源:EmfMetamodelContributor.java


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