gpt4 book ai didi

org.eclipse.xtext.xtype.XImportDeclaration.isWildcard()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 09:44:40 27 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.xtext.xtype.XImportDeclaration.isWildcard()方法的一些代码示例,展示了XImportDeclaration.isWildcard()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XImportDeclaration.isWildcard()方法的具体详情如下:
包路径:org.eclipse.xtext.xtype.XImportDeclaration
类名称:XImportDeclaration
方法名:isWildcard

XImportDeclaration.isWildcard介绍

[英]Returns the value of the 'Wildcard' attribute.

If the meaning of the 'Wildcard' attribute isn't clear, there really should be more of a description here...
[中]返回“通配符”属性的值。
如果“Wildcard”属性的含义不清楚,这里真的应该有更多的描述。。。

代码示例

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

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;
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

for (int i = 0; i < list.size(); i++) {
  XImportDeclaration staticImportDeclaration = list.get(i);
  if (staticImportDeclaration.isWildcard()) {
    if (indexToRemove == -1) {
      indexToRemove = i;

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

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);
}

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

for(XImportDeclaration importDeclaration: importDeclarations) {
  if (!importDeclaration.isStatic()) {
    if (importDeclaration.isWildcard()) {
      if (wildcardImports == null) {
        wildcardImports = Lists.newArrayListWithCapacity(4);

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

+ collidingImport2.getIdentifier() + "'.", imp, null, IssueCodes.IMPORT_COLLISION);
} else if (!imp.isWildcard()) {
  Iterable<JvmFeature> allFeatures = staticallyImportedMemberProvider.getAllFeatures(imp);
  if (!allFeatures.iterator().hasNext()) {

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

List<IEObjectDescription> descriptions = Lists.newArrayList();
for(XImportDeclaration importDeclaration: importDeclarations) {
  if (!importDeclaration.isStatic() && !importDeclaration.isWildcard() && !importDeclaration.isExtension()) {
    JvmDeclaredType importedType = importDeclaration.getImportedType();
    if (importedType == type) {

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

@Override
public void doAddImports(ITypeImporter importer) {
  List<XImportDeclaration> imports = importSection.getImportDeclarations();
  for(XImportDeclaration _import: imports) {
    if (_import.isStatic()) {
      if (_import.isWildcard()) {
        if (_import.isExtension()) {
          importer.importStaticExtension(_import.getImportedType(), false);
        } else {
          importer.importStatic(_import.getImportedType());
        }
      } else {
        if (_import.isExtension()) {
          importer.importStaticExtension(_import.getImportedType(), _import.getMemberName(), false);
        } else {
          importer.importStatic(_import.getImportedType(), _import.getMemberName());
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

boolean _matched_1 = false;
if (sourceCandidate instanceof XImportDeclaration) {
 if ((((XImportDeclaration)sourceCandidate).isStatic() && (!((XImportDeclaration)sourceCandidate).isWildcard()))) {
  _matched_1=true;
  this.addReferenceToFeatureFromStaticImport(((XImportDeclaration)sourceCandidate), targetURIs, acceptor);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com