本文整理汇总了Java中org.eclipse.xtext.xtype.XImportDeclaration.setMemberName方法的典型用法代码示例。如果您正苦于以下问题:Java XImportDeclaration.setMemberName方法的具体用法?Java XImportDeclaration.setMemberName怎么用?Java XImportDeclaration.setMemberName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xtype.XImportDeclaration
的用法示例。
在下文中一共展示了XImportDeclaration.setMemberName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addStaticImport
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
public boolean addStaticImport(JvmDeclaredType type, String memberName) {
if (hasStaticImport(staticImports, type, memberName)) {
return false;
}
Maps2.putIntoSetMap(type, memberName, staticImports);
XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration();
importDeclaration.setImportedType(type);
importDeclaration.setStatic(true);
if (memberName == null) {
importDeclaration.setWildcard(true);
} else {
importDeclaration.setMemberName(memberName);
}
addedImportDeclarations.add(importDeclaration);
return true;
}
示例2: addStaticExtensionImport
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
public boolean addStaticExtensionImport(JvmDeclaredType type, String memberName) {
if (hasStaticImport(staticExtensionImports, type, memberName)) {
return false;
}
Maps2.putIntoSetMap(type, memberName, staticExtensionImports);
XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration();
importDeclaration.setImportedType(type);
importDeclaration.setStatic(true);
importDeclaration.setExtension(true);
if (memberName == null) {
importDeclaration.setWildcard(true);
} else {
importDeclaration.setMemberName(memberName);
}
addedImportDeclarations.add(importDeclaration);
return true;
}
示例3: createImport
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
protected XImportDeclaration createImport(String importedNamespace, final String member) {
XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration();
importDeclaration.setImportedNamespace(importedNamespace);
if (member != null) {
importDeclaration.setMemberName(member);
}
return importDeclaration;
}