gpt4 book ai didi

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

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

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

XImportDeclaration.isStatic介绍

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

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

代码示例

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

@Override
  public boolean apply(XImportDeclaration input) {
    return !input.isStatic();
  }
}), false);

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

@Override
  public boolean apply(XImportDeclaration input) {
    return input.isStatic() && !input.isExtension();
  }
}), needNewline);

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

@Override
  public boolean apply(XImportDeclaration input) {
    return input.isStatic() && input.isExtension();
  }
}), needNewline);

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

protected boolean needsImport(final String fqn) {
  for (String string : implicitlyImportedPackages) {
    if (fqn.startsWith(string)) {
      return fqn.substring(string.length() + 1).lastIndexOf('.') > 0;
    }
  }
  for (XImportDeclaration importDeclr : originalImportDeclarations) {
    if (!importDeclr.isStatic() && fqn.equals(importDeclr.getImportedTypeName())) {
      return false;
    }
  }
  for (XImportDeclaration importDeclr : addedImportDeclarations) {
    String identifier = importDeclr.getImportedTypeName();
    if (!importDeclr.isStatic() && fqn.equals(identifier)) {
      return false;
    }
  }
  return true;
}

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

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

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

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

代码示例来源: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

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

boolean hasLegacyImport = false;
for(XImportDeclaration importDeclaration: importDeclarations) {
  if (!importDeclaration.isStatic()) {
    if (importDeclaration.isWildcard()) {
      if (wildcardImports == null) {

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

public Iterable<JvmFeature> getAllFeatures(final XImportDeclaration it) {
 return this.getAllFeatures(it.eResource(), it.getImportedType(), it.isStatic(), it.isExtension(), it.getMemberName());
}

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

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

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

Map<String, List<XImportDeclaration>> map = imp.isStatic() ? (imp.isExtension() ? extensionImports : staticImports) : imports;
List<XImportDeclaration> list = map.get(importedType.getIdentifier());
if (list != null) {
map.put(importedType.getIdentifier(), list);
if (!imp.isStatic()) {
  JvmType currentType = importedType;
  String currentSuffix = currentType.getSimpleName();

代码示例来源:origin: org.testeditor/org.testeditor.aml.dsl

public IScope getLocatorStrategyScope(final EObject eObject) {
 final Iterable<XImportDeclaration> enumImports = this.getEnumImports(eObject);
 final Function1<XImportDeclaration, Boolean> _function = (XImportDeclaration it) -> {
  boolean _isStatic = it.isStatic();
  return Boolean.valueOf((!_isStatic));
 };
 final Iterable<JvmEnumerationLiteral> nonStaticImportedLiterals = this.getEnumLiterals(IterableExtensions.<XImportDeclaration>filter(enumImports, _function));
 final Function<JvmEnumerationLiteral, QualifiedName> _function_1 = (JvmEnumerationLiteral it) -> {
  StringConcatenation _builder = new StringConcatenation();
  String _simpleName = it.getDeclaringType().getSimpleName();
  _builder.append(_simpleName);
  _builder.append(".");
  String _simpleName_1 = it.getSimpleName();
  _builder.append(_simpleName_1);
  return this._iQualifiedNameConverter.toQualifiedName(_builder.toString());
 };
 final IScope nonStaticScope = Scopes.<JvmEnumerationLiteral>scopeFor(nonStaticImportedLiterals, _function_1, IScope.NULLSCOPE);
 final Function1<XImportDeclaration, Boolean> _function_2 = (XImportDeclaration it) -> {
  return Boolean.valueOf(it.isStatic());
 };
 final Iterable<JvmEnumerationLiteral> staticImportedLiterals = this.getEnumLiterals(IterableExtensions.<XImportDeclaration>filter(enumImports, _function_2));
 final Function<JvmEnumerationLiteral, QualifiedName> _function_3 = (JvmEnumerationLiteral it) -> {
  return this._iQualifiedNameConverter.toQualifiedName(it.getSimpleName());
 };
 return Scopes.<JvmEnumerationLiteral>scopeFor(staticImportedLiterals, _function_3, nonStaticScope);
}

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

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

代码示例来源: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);

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

EList<XImportDeclaration> _importDeclarations = section.getImportDeclarations();
for (final XImportDeclaration imp : _importDeclarations) {
 boolean _isStatic = imp.isStatic();
 if (_isStatic) {
  final String importedTypeName = imp.getImportedTypeName();

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