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


Java XImportDeclaration.isStatic方法代码示例

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


在下文中一共展示了XImportDeclaration.isStatic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: hasStaticImport

import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
private boolean hasStaticImport(String typeName, String memberName, boolean extension) {
	for (String string : implicitlyImportedPackages) {
		if (typeName.startsWith(string)) {
			return typeName.substring(string.length()).lastIndexOf('.') == 0;
		}
	}
	Map<JvmDeclaredType, Set<String>> imports = staticImports;
	if (extension) {
		imports = staticExtensionImports;
	}
	for (JvmDeclaredType type : imports.keySet()) {
		if (typeName.equals(type.getIdentifier())) {
			Set<String> members = imports.get(type);
			return members != null && ((members.contains(memberName) || members.contains(null)));
		}
	}
	for (XImportDeclaration importDeclr : addedImportDeclarations) {
		String identifier = importDeclr.getImportedTypeName();
		if (importDeclr.isStatic() && typeName.equals(identifier)) {
			if (Objects.equal(importDeclr.getMemberName(), memberName) || importDeclr.isWildcard() || "*".equals(importDeclr.getMemberName())) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:27,代码来源:RewritableImportSection.java

示例4: 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

示例5: getImportedNamespaceResolvers

import org.eclipse.xtext.xtype.XImportDeclaration; //导入方法依赖的package包/类
protected List<ImportNormalizer> getImportedNamespaceResolvers(XImportSection importSection, boolean ignoreCase) {
	List<XImportDeclaration> importDeclarations = importSection.getImportDeclarations();
	List<ImportNormalizer> result = Lists.newArrayListWithExpectedSize(importDeclarations.size());
	for (XImportDeclaration imp: importDeclarations) {
		if (!imp.isStatic()) {
			String value = imp.getImportedNamespace();
			if(value == null)
				value = imp.getImportedTypeName();
			ImportNormalizer resolver = createImportedNamespaceResolver(value, ignoreCase);
			if (resolver != null)
				result.add(resolver);
		}
	}
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:XImportSectionNamespaceScopeProvider.java

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