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


Java XImportDeclaration.getImportedType方法代码示例

本文整理汇总了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);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:27,代码来源:RewritableImportSection.java

示例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);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:25,代码来源:RewritableImportSection.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:17,代码来源:StaticallyImportedMemberProvider.java

示例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);
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:XbaseValidator.java

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


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