Tabnine Logo
JvmGenericType.getSuperTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
getSuperTypes
method
in
org.eclipse.xtext.common.types.JvmGenericType

Best Java code snippets using org.eclipse.xtext.common.types.JvmGenericType.getSuperTypes (Showing top 20 results out of 315)

origin: org.eclipse.emf.parsley/org.eclipse.emf.parsley.dsl

protected boolean hasCycleInHierarchy(final JvmGenericType type, final Set<JvmGenericType> processedSuperTypes) {
 boolean _contains = processedSuperTypes.contains(type);
 if (_contains) {
  return true;
 }
 processedSuperTypes.add(type);
 final Function1<JvmTypeReference, JvmType> _function = new Function1<JvmTypeReference, JvmType>() {
  @Override
  public JvmType apply(final JvmTypeReference it) {
   return it.getType();
  }
 };
 Iterable<JvmGenericType> _filter = Iterables.<JvmGenericType>filter(ListExtensions.<JvmTypeReference, JvmType>map(type.getSuperTypes(), _function), JvmGenericType.class);
 for (final JvmGenericType genericType : _filter) {
  boolean _hasCycleInHierarchy = this.hasCycleInHierarchy(genericType, processedSuperTypes);
  if (_hasCycleInHierarchy) {
   return true;
  }
 }
 processedSuperTypes.remove(type);
 return false;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

protected boolean hasCycleInHierarchy(JvmGenericType type, Set<JvmGenericType> processedSuperTypes) {
  JvmDeclaredType container = type;
  do {
    if (processedSuperTypes.contains(container))
      return true;
    container = container.getDeclaringType();
  } while (container != null);
  processedSuperTypes.add(type);
  for (JvmTypeReference superTypeRef : type.getSuperTypes()) {
    if (superTypeRef.getType() instanceof JvmGenericType) {
      if (hasCycleInHierarchy((JvmGenericType) superTypeRef.getType(), processedSuperTypes))
        return true;
    }
  }
  processedSuperTypes.remove(type);
  return false;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public void setExtendedInterfaces(final Iterable<? extends TypeReference> superinterfaces) {
 this.checkMutable();
 ConditionUtils.checkIterable(superinterfaces, "superinterfaces");
 this.getDelegate().getSuperTypes().clear();
 for (final TypeReference typeRef : superinterfaces) {
  {
   boolean _isInferred = typeRef.isInferred();
   if (_isInferred) {
    throw new IllegalArgumentException("Cannot use inferred type as extended interface.");
   }
   EList<JvmTypeReference> _superTypes = this.getDelegate().getSuperTypes();
   JvmTypeReference _jvmTypeReference = this.getCompilationUnit().toJvmTypeReference(typeRef);
   _superTypes.add(_jvmTypeReference);
  }
 }
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public void apply(final JvmGenericType it) {
  it.setPackageName(packageName);
  EList<JvmTypeReference> _superTypes = it.getSuperTypes();
  JvmTypeReference _typeRef = EMFPatternLanguageJvmModelInferrer.this._typeReferenceBuilder.typeRef(BasePatternMatch.class);
  EMFPatternLanguageJvmModelInferrer.this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef);
 }
};
origin: org.eclipse.emf.parsley/org.eclipse.emf.parsley.dsl

 private Iterable<JvmOperation> superTypeJvmOperations(final JvmGenericType type) {
  if ((type == null)) {
   return CollectionLiterals.<JvmOperation>emptyList();
  }
  JvmType _type = IterableExtensions.<JvmTypeReference>head(type.getSuperTypes()).getType();
  return Iterables.<JvmOperation>filter(((JvmGenericType) _type).getAllFeatures(), JvmOperation.class);
 }
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public void apply(final JvmGenericType it) {
  it.setPackageName(packageName);
  EList<JvmTypeReference> _superTypes = it.getSuperTypes();
  JvmTypeReference _typeRef = EMFPatternLanguageJvmModelInferrer.this._typeReferenceBuilder.typeRef(matchClass);
  JvmTypeReference _typeRef_1 = EMFPatternLanguageJvmModelInferrer.this._typeReferenceBuilder.typeRef(BaseMatcher.class, _typeRef);
  EMFPatternLanguageJvmModelInferrer.this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef_1);
 }
};
origin: org.eclipse.emf.parsley/org.eclipse.emf.parsley.dsl

private boolean setSuperClassType(final JvmGenericType e, final WithExtendsClause dslElement, final Class<?> defaultSuperClass) {
 boolean _xifexpression = false;
 ExtendsClause _extendsClause = dslElement.getExtendsClause();
 boolean _tripleNotEquals = (_extendsClause != null);
 if (_tripleNotEquals) {
  EList<JvmTypeReference> _superTypes = e.getSuperTypes();
  JvmTypeReference _cloneWithProxies = this._jvmTypesBuilder.cloneWithProxies(dslElement.getExtendsClause().getSuperType());
  _xifexpression = this._jvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _cloneWithProxies);
 } else {
  EList<JvmTypeReference> _superTypes_1 = e.getSuperTypes();
  JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(defaultSuperClass);
  _xifexpression = this._jvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes_1, _typeRef);
 }
 return _xifexpression;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public void registerClass(final String qualifiedName) throws IllegalArgumentException {
 final JvmGenericType newType = TypesFactory.eINSTANCE.createJvmGenericType();
 newType.setVisibility(JvmVisibility.PUBLIC);
 EList<JvmTypeReference> _superTypes = newType.getSuperTypes();
 JvmTypeReference _typeForName = this.compilationUnit.getTypeReferences().getTypeForName(Object.class, this.compilationUnit.getXtendFile());
 _superTypes.add(_typeForName);
 this.setNameAndAccept(newType, qualifiedName);
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Check
public void checkSuperTypes(AnonymousClass anonymousClass) {
  JvmGenericType inferredType = associations.getInferredType(anonymousClass);
  if (inferredType != null) {
    JvmTypeReference superTypeRef = Iterables.getLast(inferredType.getSuperTypes());
    JvmType superType = superTypeRef.getType();
    if(superType instanceof JvmGenericType && ((JvmGenericType) superType).isFinal())
      error("Attempt to override final class", anonymousClass.getConstructorCall(), XCONSTRUCTOR_CALL__CONSTRUCTOR, INSIGNIFICANT_INDEX, OVERRIDDEN_FINAL);
  }
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public void setImplementedInterfaces(final Iterable<? extends TypeReference> superInterfaces) {
 this.checkMutable();
 ConditionUtils.checkIterable(superInterfaces, "superIntefaces");
 ConditionUtils.checkInferredTypeReferences("implemented interface", ((TypeReference[])Conversions.unwrapArray(superInterfaces, TypeReference.class)));
 final Function1<JvmTypeReference, Boolean> _function = (JvmTypeReference it) -> {
  return Boolean.valueOf(((it.getType() instanceof JvmGenericType) && ((JvmGenericType) it.getType()).isInterface()));
 };
 final Iterable<JvmTypeReference> oldInterfaces = IterableExtensions.<JvmTypeReference>filter(this.getDelegate().getSuperTypes(), _function);
 CollectionExtensions.<JvmTypeReference>removeAll(this.getDelegate().getSuperTypes(), oldInterfaces);
 final Function1<TypeReference, JvmTypeReference> _function_1 = (TypeReference it) -> {
  return this.getCompilationUnit().toJvmTypeReference(it);
 };
 Iterables.<JvmTypeReference>addAll(this.getDelegate().getSuperTypes(), IterableExtensions.map(superInterfaces, _function_1));
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public void apply(final JvmGenericType it) {
  String _packageName = model.getPackageName();
  it.setPackageName(_packageName);
  it.setFinal(true);
  EList<JvmTypeReference> _superTypes = it.getSuperTypes();
  JvmTypeReference _typeRef = PatternGroupClassInferrer.this.builder.typeRef(BaseGeneratedPatternGroup.class);
  PatternGroupClassInferrer.this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef);
 }
};
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected void _visit(final JvmGenericType jvmType, final INode originNode, final ImportsAcceptor acceptor) {
 boolean _isAnonymous = jvmType.isAnonymous();
 if (_isAnonymous) {
  this.visit(IterableExtensions.<JvmTypeReference>last(jvmType.getSuperTypes()).getType(), originNode, acceptor);
 } else {
  this._visit(((JvmDeclaredType) jvmType), originNode, acceptor);
 }
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public void apply(final JvmGenericType it) {
  it.setVisibility(JvmVisibility.PRIVATE);
  it.setStatic(true);
  EList<JvmTypeReference> _superTypes = it.getSuperTypes();
  JvmTypeReference _typeRef = PatternQuerySpecificationClassInferrer.this.builder.typeRef(BaseGeneratedEMFPQuery.class);
  PatternQuerySpecificationClassInferrer.this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef);
  PatternQuerySpecificationClassInferrer.this.inferPQueryMembers(it, pattern, specBuilder);
 }
};
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public void apply(final JvmGenericType it) {
  it.setPackageName(processorPackageName);
  CharSequence _javadocProcessorClass = PatternMatchProcessorClassInferrer.this._javadocInferrer.javadocProcessorClass(pattern);
  String _string = _javadocProcessorClass.toString();
  PatternMatchProcessorClassInferrer.this._eMFJvmTypesBuilder.setDocumentation(it, _string);
  it.setAbstract(true);
  EList<JvmTypeReference> _superTypes = it.getSuperTypes();
  JvmTypeReference _typeRef = PatternMatchProcessorClassInferrer.this.builder.typeRef(matchClass);
  JvmTypeReference _typeRef_1 = PatternMatchProcessorClassInferrer.this.builder.typeRef(IMatchProcessor.class, _typeRef);
  PatternMatchProcessorClassInferrer.this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef_1);
 }
};
origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public void setExtendedClass(final TypeReference superclass) {
 this.checkMutable();
 ConditionUtils.checkInferredTypeReferences("extended class", superclass);
 JvmTypeReference _xifexpression = null;
 if ((superclass != null)) {
  _xifexpression = this.getCompilationUnit().toJvmTypeReference(superclass);
 } else {
  _xifexpression = this.getCompilationUnit().getTypeReferences().getTypeForName(Object.class, this.getCompilationUnit().getXtendFile());
 }
 final JvmTypeReference newTypeRef = _xifexpression;
 final Function1<JvmTypeReference, Boolean> _function = (JvmTypeReference it) -> {
  return Boolean.valueOf(((it.getType() instanceof JvmGenericType) && (!((JvmGenericType) it.getType()).isInterface())));
 };
 final JvmTypeReference oldType = IterableExtensions.<JvmTypeReference>findFirst(this.getDelegate().getSuperTypes(), _function);
 if ((oldType != null)) {
  this.getDelegate().getSuperTypes().remove(oldType);
 }
 this.getDelegate().getSuperTypes().add(newTypeRef);
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public Iterable<? extends TypeReference> getExtendedInterfaces() {
 List<TypeReference> _xblockexpression = null;
 {
  final Function1<JvmTypeReference, Boolean> _function = (JvmTypeReference it) -> {
   JvmType _type = it.getType();
   return Boolean.valueOf(((JvmGenericType) _type).isInterface());
  };
  final Iterable<JvmTypeReference> filtered = IterableExtensions.<JvmTypeReference>filter(this.getDelegate().getSuperTypes(), _function);
  final Function1<JvmTypeReference, TypeReference> _function_1 = (JvmTypeReference it) -> {
   return this.getCompilationUnit().toTypeReference(it);
  };
  _xblockexpression = IterableExtensions.<TypeReference>toList(IterableExtensions.<JvmTypeReference, TypeReference>map(filtered, _function_1));
 }
 return _xblockexpression;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public Iterable<? extends TypeReference> getImplementedInterfaces() {
 List<TypeReference> _xblockexpression = null;
 {
  final Function1<JvmTypeReference, Boolean> _function = (JvmTypeReference it) -> {
   JvmType _type = it.getType();
   return Boolean.valueOf(((JvmGenericType) _type).isInterface());
  };
  final Iterable<JvmTypeReference> filtered = IterableExtensions.<JvmTypeReference>filter(this.getDelegate().getSuperTypes(), _function);
  final Function1<JvmTypeReference, TypeReference> _function_1 = (JvmTypeReference it) -> {
   return this.getCompilationUnit().toTypeReference(it);
  };
  _xblockexpression = IterableExtensions.<TypeReference>toList(IterableExtensions.<JvmTypeReference, TypeReference>map(filtered, _function_1));
 }
 return _xblockexpression;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

  @Override
  @SuppressWarnings("deprecation")
  public void accept(JvmTypeReference capturingTypeReference) {
    casted.setEquivalent(capturingTypeReference);
    IFeatureScopeSession mySession = addThisAndSuper(nestedSession, resolvedTypes.getReferenceOwner(), localClass, superTypeReference, false);
    if(type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE && ((JvmGenericType) type).isInterface()
        || type.eClass() == TypesPackage.Literals.JVM_ANNOTATION_TYPE) {
      localClass.getSuperTypes().add(0, typesBuilder.newTypeRef(localClass, Object.class));
      inferAnonymousClassConstructor(anonymousClass, localClass);
    } else {
      for(JvmMember superMember: type.getMembers()) {
        if (superMember instanceof JvmConstructor) {
          JvmConstructor superTypeConstructor = (JvmConstructor) superMember;
          boolean visible = mySession.isVisible(superTypeConstructor);
          inferAnonymousClassConstructor(anonymousClass, localClass, superTypeConstructor, visible);
        }
      }
    }
  }
});
origin: org.eclipse.viatra/org.eclipse.viatra.query.patternlanguage.emf

public JvmGenericType inferPatternGroupClass(final PatternModel model, final JvmTypeReferenceBuilder builder, final EMFPatternLanguageGeneratorConfig config, final boolean includePrivate) {
 JvmGenericType _xblockexpression = null;
 {
  this.builder = builder;
  final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> {
   it.setPackageName(this.groupPackageName(model, includePrivate));
   it.setFinal(true);
   EList<JvmTypeReference> _superTypes = it.getSuperTypes();
   JvmTypeReference _typeRef = this.builder.typeRef(BaseGeneratedPatternGroup.class);
   this._eMFJvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _typeRef);
   this._eMFJvmTypesBuilder.setFileHeader(it, this._eMFPatternLanguageJvmModelInferrerUtil.getFileComment(model));
  };
  _xblockexpression = this._eMFJvmTypesBuilder.toClass(model, this.groupClassName(model, includePrivate), _function);
 }
 return _xblockexpression;
}

origin: org.eclipse.xtend/org.eclipse.xtend.core

protected void initialize(XtendInterface source, JvmGenericType inferredJvmType) {
  inferredJvmType.setVisibility(source.getVisibility());
  inferredJvmType.setStatic(source.isStatic() && !isTopLevel(source));
  inferredJvmType.setAbstract(true);
  inferredJvmType.setStrictFloatingPoint(source.isStrictFloatingPoint());
  translateAnnotationsTo(source.getAnnotations(), inferredJvmType);
  for (JvmTypeReference intf : source.getExtends()) {
    inferredJvmType.getSuperTypes().add(jvmTypesBuilder.cloneWithProxies(intf));
  }
  fixTypeParameters(inferredJvmType);
  for (XtendMember member : source.getMembers()) {
    if (member instanceof XtendField
        || (member instanceof XtendFunction && ((XtendFunction) member).getName() != null)) {
      transform(member, inferredJvmType, false);
    }
  }
  jvmTypesBuilder.copyDocumentationTo(source, inferredJvmType);
  nameClashResolver.resolveNameClashes(inferredJvmType);
}

org.eclipse.xtext.common.typesJvmGenericTypegetSuperTypes

Popular methods of JvmGenericType

  • getMembers
  • isInterface
    Returns the value of the 'Interface' attribute. If the meaning of the 'Interface' attribute isn't cl
  • getTypeParameters
  • getDeclaredConstructors
  • setAbstract
  • setInterface
    Sets the value of the ' org.eclipse.xtext.common.types.JvmGenericType#isInterface' attribute.
  • setPackageName
  • setSimpleName
  • setVisibility
  • getAllFeatures
  • getSimpleName
  • isAbstract
  • getSimpleName,
  • isAbstract,
  • setFinal,
  • setStatic,
  • setStrictFloatingPoint,
  • getDeclaredFields,
  • getDeclaredOperations,
  • getIdentifier,
  • isFinal

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Path (java.nio.file)
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JTable (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now