gpt4 book ai didi

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

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

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

XImportDeclaration.getImportedType介绍

[英]Returns the value of the 'Imported Type' reference.

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

代码示例

代码示例来源: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: io.sarl.pythongenerator/io.sarl.pythongenerator.generator

/** Check that import mapping are known.
 *
 * @param importDeclaration the declaration.
 */
@Check
public void checkImportsMapping(XImportDeclaration importDeclaration) {
  final JvmDeclaredType type = importDeclaration.getImportedType();
  doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
}

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

protected boolean isImportDeclarationRequired(final ITypeDescriptor typeDesc, final String qualifiedName, final ContentAssistContext context, final XImportSection importSection) {
 return ((!(typeDesc.getName().startsWith("java.lang") && (typeDesc.getName().lastIndexOf(".") == 9))) && ((importSection == null) || (!IterableExtensions.<XImportDeclaration>exists(importSection.getImportDeclarations(), ((Function1<XImportDeclaration, Boolean>) (XImportDeclaration it) -> {
  JvmDeclaredType _importedType = it.getImportedType();
  String _qualifiedName = null;
  if (_importedType!=null) {
   _qualifiedName=_importedType.getQualifiedName();
  }
  return Boolean.valueOf(Objects.equal(_qualifiedName, qualifiedName));
 })))));
}

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

private Iterable<JvmEnumerationLiteral> getEnumLiterals(final Iterable<XImportDeclaration> imports) {
  final Function1<XImportDeclaration, JvmEnumerationType> _function = (XImportDeclaration it) -> {
   JvmDeclaredType _importedType = it.getImportedType();
   return ((JvmEnumerationType) _importedType);
  };
  final Function1<JvmEnumerationType, EList<JvmEnumerationLiteral>> _function_1 = (JvmEnumerationType it) -> {
   return it.getLiterals();
  };
  return Iterables.<JvmEnumerationLiteral>concat(IterableExtensions.<JvmEnumerationType, EList<JvmEnumerationLiteral>>map(IterableExtensions.<XImportDeclaration, JvmEnumerationType>map(imports, _function), _function_1));
 }
}

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

@Check
public void checkDeprecated(XImportDeclaration decl) {
  if (!isIgnored(DEPRECATED_MEMBER_REFERENCE)) {
    JvmType jvmType = decl.getImportedType();
    checkDeprecated(
        jvmType,
        decl,
        XtypePackage.Literals.XIMPORT_DECLARATION__IMPORTED_TYPE);
  }
}

代码示例来源: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.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.testeditor/org.testeditor.aml.dsl

private Iterable<XImportDeclaration> getEnumImports(final EObject eObject) {
 EObject _rootContainer = EcoreUtil2.getRootContainer(eObject);
 final AmlModel rootElement = ((AmlModel) _rootContainer);
 final XImportSection importSection = rootElement.getImportSection();
 if ((importSection != null)) {
  final Function1<XImportDeclaration, Boolean> _function = (XImportDeclaration it) -> {
   JvmDeclaredType _importedType = it.getImportedType();
   return Boolean.valueOf((_importedType instanceof JvmEnumerationType));
  };
  return IterableExtensions.<XImportDeclaration>filter(rootElement.getImportSection().getImportDeclarations(), _function);
 } else {
  return Collections.<XImportDeclaration>unmodifiableList(CollectionLiterals.<XImportDeclaration>newArrayList());
 }
}

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

wildcardImports.add(AbstractNestedTypeAwareImportNormalizer.createNestedTypeAwareImportNormalizer(qualifiedImportedNamespace, true, false));
} else {
  JvmDeclaredType importedType = importDeclaration.getImportedType();
  if (importedType != null && !importedType.eIsProxy()) {
    if (concreteImports == null || importedNames == null /* to make JDT happy */) {

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

JvmType importedType = imp.getImportedType();
if (importedType == null || importedType.eIsProxy()) {
  continue;

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

for(XImportDeclaration importDeclaration: importDeclarations) {
  if (!importDeclaration.isStatic() && !importDeclaration.isWildcard() && !importDeclaration.isExtension()) {
    JvmDeclaredType importedType = importDeclaration.getImportedType();
    if (importedType == type) {
      String syntax = importsConfiguration.getLegacyImportSyntax(importDeclaration);

代码示例来源:origin: io.sarl.lang/io.sarl.lang

if (importSection != null) {
  for (XImportDeclaration decl : importSection.getImportDeclarations()) {
    concreteImports.addImportFor(decl.getImportedType());

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