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


Java EcoreUtil2.typeSelect方法代码示例

本文整理汇总了Java中org.eclipse.xtext.EcoreUtil2.typeSelect方法的典型用法代码示例。如果您正苦于以下问题:Java EcoreUtil2.typeSelect方法的具体用法?Java EcoreUtil2.typeSelect怎么用?Java EcoreUtil2.typeSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.EcoreUtil2的用法示例。


在下文中一共展示了EcoreUtil2.typeSelect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerSimpleNamesOfInnerClasses

import org.eclipse.xtext.EcoreUtil2; //导入方法依赖的package包/类
protected void registerSimpleNamesOfInnerClasses(JvmDeclaredType thisType, LinkedHashSet<JvmType> handled) {
	if (!handled.add(thisType))
		return;
	List<JvmDeclaredType> nested = EcoreUtil2.typeSelect(thisType.getMembers(), JvmDeclaredType.class);
	for (JvmDeclaredType jvmDeclaredType : nested) {
		getThisTypeSimpleNames().add(jvmDeclaredType.getSimpleName());
		getThisTypeQualifiedNames().add(jvmDeclaredType.getQualifiedName(getInnerTypeSeparator()));
		thisCollidesWithJavaLang |= CodeGenUtil2.isJavaLangType(jvmDeclaredType.getSimpleName());
	}
	for (JvmTypeReference superType: thisType.getSuperTypes()) {
		if (superType.getType() instanceof JvmDeclaredType) {
			registerSimpleNamesOfInnerClasses((JvmDeclaredType) superType.getType(), handled);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:ImportManager.java

示例2: getParameters

import org.eclipse.xtext.EcoreUtil2; //导入方法依赖的package包/类
@Override
protected List<Object> getParameters(Grammar grammar) {
	List<String> packageQNames = new ArrayList<String>();
	List<GeneratedMetamodel> list = EcoreUtil2.typeSelect(grammar.getMetamodelDeclarations(),
			GeneratedMetamodel.class);
	for (GeneratedMetamodel generatedMetamodel : list) {
		packageQNames.add(getGeneratedEPackageName(grammar, getNaming(), generatedMetamodel.getEPackage()));
	}
	List<Object> parameters = Lists.newArrayList((Object) packageQNames);
	parameters.add(this.composedChecks);
	parameters.add(getValidatorSuperClassName(grammar));
	return parameters;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:JavaValidatorFragment.java

示例3: checkConfigurationInternal

import org.eclipse.xtext.EcoreUtil2; //导入方法依赖的package包/类
@Override
protected void checkConfigurationInternal(Issues issues) {
	naming.setProjectNameRt(getProjectNameRt());
	naming.setProjectNameIde(getProjectNameIde());
	naming.setIdeBasePackage(!isIde() && isUi() ? getProjectNameUi() : getProjectNameIde());
	naming.setProjectNameUi(getProjectNameUi());
	naming.setUiBasePackage(getProjectNameUi());
	naming.setActivatorName(getActivator());
	naming.setPathTestProject(getPathTestProject());
	naming.setFileHeader(getFileHeader());
	naming.setClassAnnotations(getClassAnnotationsAsString());
	naming.setAnnotationImports(getAnnotationImportsAsString());
	naming.setHasUI(isUi());
	naming.setHasIde(isIde());
	Map<String, Grammar> uris = new HashMap<String, Grammar>();
	for (LanguageConfig config : languageConfigs) {
		config.registerNaming(naming);
		config.checkConfiguration(issues);
		Grammar grammar = config.getGrammar();
		List<GeneratedMetamodel> select = EcoreUtil2.typeSelect(grammar.getMetamodelDeclarations(),
				GeneratedMetamodel.class);
		for (GeneratedMetamodel generatedMetamodel : select) {
			String nsURI = generatedMetamodel.getEPackage().getNsURI();
			if (uris.containsKey(nsURI)) {
				issues.addError("Duplicate generated grammar with nsURI '" + nsURI + "' in "
						+ uris.get(nsURI).getName() + " and " + grammar.getName());
			} else {
				uris.put(nsURI, grammar);
			}
		}
	}
	if (getProjectNameRt() == null)
		issues.addError("The property 'projectNameRt' is mandatory");
	if (isUiMergedIntoRt() && getPathIdeProject() != null && ! isIdeMergedIntoRt()) {
		issues.addError("Cannot have a dedicated ide project when ui project is merged into runtime project");
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:38,代码来源:Generator.java

示例4: getGeneratedEPackageURIs

import org.eclipse.xtext.EcoreUtil2; //导入方法依赖的package包/类
private Set<String> getGeneratedEPackageURIs() {
	List<GeneratedMetamodel> list = EcoreUtil2.typeSelect(grammar.getMetamodelDeclarations(), GeneratedMetamodel.class);
	return Sets.newLinkedHashSet(Iterables.transform(list, new Function<GeneratedMetamodel, String>() {
		@Override
		public String apply(GeneratedMetamodel from) {
			return from.getEPackage()!=null?from.getEPackage().getNsURI() : null;
		}
	}));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:10,代码来源:Xtext2EcoreTransformer.java


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