Package com.google.dart.engine.type

Examples of com.google.dart.engine.type.InterfaceType


        for (InterfaceType mixinType : currentElement.getMixins()) {
          ClassElement mixinElement = mixinType.getElement();
          classesToVisit.add(mixinElement);
        }
        // check super
        InterfaceType supertype = currentElement.getSupertype();
        if (supertype != null) {
          ClassElement superElement = supertype.getElement();
          if (superElement != null) {
            classesToVisit.add(superElement);
          }
        }
      }
View Full Code Here


  private void collectAllSupertypes(ArrayList<InterfaceType> supertypes) {
    ArrayList<InterfaceType> typesToVisit = new ArrayList<InterfaceType>();
    ArrayList<ClassElement> visitedClasses = new ArrayList<ClassElement>();
    typesToVisit.add(this.getType());
    while (!typesToVisit.isEmpty()) {
      InterfaceType currentType = typesToVisit.remove(0);
      ClassElement currentElement = currentType.getElement();
      if (!visitedClasses.contains(currentElement)) {
        visitedClasses.add(currentElement);
        if (currentType != this.getType()) {
          supertypes.add(currentType);
        }
        InterfaceType supertype = currentType.getSuperclass();
        if (supertype != null) {
          typesToVisit.add(supertype);
        }
        for (InterfaceType type : currentElement.getInterfaces()) {
          typesToVisit.add(type);
View Full Code Here

          if (element != null && element.isAccessibleIn(library)) {
            return element;
          }
        }
      }
      InterfaceType supertype = currentElement.getSupertype();
      if (supertype == null) {
        return null;
      }
      currentElement = supertype.getElement();
      PropertyAccessorElement element = currentElement.getGetter(getterName);
      if (element != null && element.isAccessibleIn(library)) {
        return element;
      }
    }
View Full Code Here

          if (element != null && element.isAccessibleIn(library)) {
            return element;
          }
        }
      }
      InterfaceType supertype = currentElement.getSupertype();
      if (supertype == null) {
        return null;
      }
      currentElement = supertype.getElement();
      MethodElement element = currentElement.getMethod(methodName);
      if (element != null && element.isAccessibleIn(library)) {
        return element;
      }
    }
View Full Code Here

          if (element != null && element.isAccessibleIn(library)) {
            return element;
          }
        }
      }
      InterfaceType supertype = currentElement.getSupertype();
      if (supertype == null) {
        return null;
      }
      currentElement = supertype.getElement();
      PropertyAccessorElement element = currentElement.getSetter(setterName);
      if (element != null && element.isAccessibleIn(library)) {
        return element;
      }
    }
View Full Code Here

      if (futureElement == null) {
        AnalysisEngine.getInstance().getLogger().logError(
            "Could not find type Future in dart:async");
        return VoidTypeImpl.getInstance();
      }
      InterfaceType futureType = futureElement.getType();
      return futureType.substitute(new Type[] {DynamicTypeImpl.getInstance()});
    } catch (AnalysisException exception) {
      AnalysisEngine.getInstance().getLogger().logError(
          "Could not build the element model for dart:async",
          exception);
      return VoidTypeImpl.getInstance();
View Full Code Here

  @SuppressWarnings("unchecked")
  public <E extends Element> E getAncestor(Class<E> elementClass) {
    E element = getBaseElement().getAncestor(elementClass);
    ParameterizedType definingType = getDefiningType();
    if (definingType instanceof InterfaceType) {
      InterfaceType definingInterfaceType = (InterfaceType) definingType;
      if (element instanceof ConstructorElement) {
        return (E) ConstructorMember.from((ConstructorElement) element, definingInterfaceType);
      } else if (element instanceof MethodElement) {
        return (E) MethodMember.from((MethodElement) element, definingInterfaceType);
      } else if (element instanceof PropertyAccessorElement) {
View Full Code Here

      private boolean isScope(Expression target) {
        if (target != null) {
          Type type = target.getBestType();
          if (type instanceof InterfaceType) {
            InterfaceType interfaceType = (InterfaceType) type;
            return interfaceType.getName().equals("Scope");
          }
        }
        return false;
      }
    });
View Full Code Here

          Element element = identifier.getStaticElement();
          if (element instanceof VariableElement) {
            VariableElement variable = (VariableElement) element;
            Type type = variable.getType();
            if (type instanceof InterfaceType) {
              InterfaceType interfaceType = (InterfaceType) type;
              return interfaceType.getName().equals("ViewFactory");
            }
          }
        }
        return false;
      }
View Full Code Here

   * @param typeProvider the type provider used to find known types
   * @return the result of applying boolean conversion to this object
   * @throws EvaluationException if the operator is not appropriate for an object of this kind
   */
  public DartObjectImpl convertToBool(TypeProvider typeProvider) throws EvaluationException {
    InterfaceType boolType = typeProvider.getBoolType();
    if (type == boolType) {
      return this;
    }
    return new DartObjectImpl(boolType, state.convertToBool());
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.type.InterfaceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.