本文整理汇总了Java中org.eclipse.xtext.xtype.XImportDeclaration.getImportedType方法的典型用法代码示例。如果您正苦于以下问题:Java XImportDeclaration.getImportedType方法的具体用法?Java XImportDeclaration.getImportedType怎么用?Java XImportDeclaration.getImportedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xtype.XImportDeclaration
的用法示例。
在下文中一共展示了XImportDeclaration.getImportedType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RewritableImportSection
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
public RewritableImportSection(XtextResource resource, IImportsConfiguration importsConfiguration, XImportSection originalImportSection,
String lineSeparator, ImportSectionRegionUtil regionUtil, IValueConverter<String> nameConverter) {
this.importsConfiguration = importsConfiguration;
this.resource = resource;
this.lineSeparator = lineSeparator;
this.regionUtil = regionUtil;
this.nameValueConverter = nameConverter;
this.implicitlyImportedPackages = importsConfiguration.getImplicitlyImportedPackages(resource);
this.importRegion = regionUtil.computeRegion(resource);
if (originalImportSection != null) {
for (XImportDeclaration originalImportDeclaration : originalImportSection.getImportDeclarations()) {
this.originalImportDeclarations.add(originalImportDeclaration);
JvmDeclaredType importedType = originalImportDeclaration.getImportedType();
if (originalImportDeclaration.isStatic()) {
String memberName = originalImportDeclaration.getMemberName();
if (originalImportDeclaration.isExtension()) {
Maps2.putIntoSetMap(importedType, memberName, staticExtensionImports);
} else {
Maps2.putIntoSetMap(importedType, memberName, staticImports);
}
} else if (importedType != null) {
Maps2.putIntoListMap(importedType.getSimpleName(), importedType, plainImports);
}
}
}
}
示例2: appendImport
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
protected void appendImport(StringBuilder builder, XImportDeclaration newImportDeclaration) {
builder.append("import ");
if (newImportDeclaration.isStatic()) {
builder.append("static ");
if (newImportDeclaration.isExtension()) {
builder.append("extension ");
}
}
String qualifiedTypeName = newImportDeclaration.getImportedNamespace();
if (newImportDeclaration.getImportedType() != null) {
qualifiedTypeName = serializeType(newImportDeclaration.getImportedType());
}
String escapedTypeName = nameValueConverter.toString(qualifiedTypeName);
builder.append(escapedTypeName);
if (newImportDeclaration.isStatic()) {
builder.append(".");
if (newImportDeclaration.isWildcard()) {
builder.append("*");
} else {
builder.append(newImportDeclaration.getMemberName());
}
}
builder.append(lineSeparator);
}
示例3: findAllFeatures
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
public Iterable<JvmFeature> findAllFeatures(final XImportDeclaration it) {
Iterable<JvmFeature> _xblockexpression = null;
{
final JvmDeclaredType importedType = it.getImportedType();
if (((!it.isStatic()) || (importedType == null))) {
return CollectionLiterals.<JvmFeature>emptyList();
}
final IVisibilityHelper visibilityHelper = this.getVisibilityHelper(it.eResource());
final IResolvedFeatures resolvedFeatures = this._provider.getResolvedFeatures(importedType);
final Function1<JvmFeature, Boolean> _function = (JvmFeature feature) -> {
return Boolean.valueOf(((feature.isStatic() && visibilityHelper.isVisible(feature)) && ((it.getMemberName() == null) || feature.getSimpleName().startsWith(it.getMemberName()))));
};
_xblockexpression = IterableExtensions.<JvmFeature>filter(resolvedFeatures.getAllFeatures(), _function);
}
return _xblockexpression;
}
示例4: checkDeprecated
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
@Check
public void checkDeprecated(XImportDeclaration decl) {
if (!isIgnored(DEPRECATED_MEMBER_REFERENCE)) {
JvmType jvmType = decl.getImportedType();
checkDeprecated(
jvmType,
decl,
XtypePackage.Literals.XIMPORT_DECLARATION__IMPORTED_TYPE);
}
}
示例5: findOriginalImports
import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
protected List<XImportDeclaration> findOriginalImports(JvmDeclaredType type, String memberName, Collection<XImportDeclaration> list, boolean isStatic,
boolean isExtension) {
List<XImportDeclaration> result = newArrayList();
for (XImportDeclaration importDeclaration : list) {
if (!(isStatic ^ importDeclaration.isStatic()) && !(isExtension ^ importDeclaration.isExtension()) && importDeclaration.getImportedType() == type
&& (memberName == null || memberName.equals(importDeclaration.getMemberName()))) {
result.add(importDeclaration);
}
}
return result;
}