本文整理汇总了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);
}
}
}
示例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;
}
示例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");
}
}
示例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;
}
}));
}