Package com.google.dart.engine.type

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


          visitedInterfaces);
      if (member != null) {
        return member;
      }
    }
    InterfaceType superclass = targetType.getSuperclass();
    if (superclass == null) {
      return null;
    }
    return lookUpGetterOrMethodInInterfaces(superclass, true, memberName, visitedInterfaces);
  }
View Full Code Here


   * @return the element representing the method that was found
   */
  private MethodElement lookUpMethod(Expression target, Type type, String methodName) {
    type = resolveTypeParameter(type);
    if (type instanceof InterfaceType) {
      InterfaceType interfaceType = (InterfaceType) type;
      MethodElement method;
      if (target instanceof SuperExpression) {
        method = interfaceType.lookUpMethodInSuperclass(methodName, definingLibrary);
      } else {
        method = interfaceType.lookUpMethod(methodName, definingLibrary);
      }
      if (method != null) {
        return method;
      }
      return lookUpMethodInInterfaces(interfaceType, false, methodName, new HashSet<ClassElement>());
View Full Code Here

          visitedInterfaces);
      if (method != null) {
        return method;
      }
    }
    InterfaceType superclass = targetType.getSuperclass();
    if (superclass == null) {
      return null;
    }
    return lookUpMethodInInterfaces(superclass, true, methodName, visitedInterfaces);
  }
View Full Code Here

   * @return the element representing the setter that was found
   */
  private PropertyAccessorElement lookUpSetter(Expression target, Type type, String setterName) {
    type = resolveTypeParameter(type);
    if (type instanceof InterfaceType) {
      InterfaceType interfaceType = (InterfaceType) type;
      PropertyAccessorElement accessor;
      if (target instanceof SuperExpression) {
        accessor = interfaceType.lookUpSetterInSuperclass(setterName, definingLibrary);
      } else {
        accessor = interfaceType.lookUpSetter(setterName, definingLibrary);
      }
      if (accessor != null) {
        return accessor;
      }
      return lookUpSetterInInterfaces(interfaceType, false, setterName, new HashSet<ClassElement>());
View Full Code Here

          visitedInterfaces);
      if (setter != null) {
        return setter;
      }
    }
    InterfaceType superclass = targetType.getSuperclass();
    if (superclass == null) {
      return null;
    }
    return lookUpSetterInInterfaces(superclass, true, setterName, visitedInterfaces);
  }
View Full Code Here

      // If it isn't defined in the lexical scope, and the invocation is within a class, then look
      // in the inheritance scope.
      //
      ClassElement enclosingClass = resolver.getEnclosingClass();
      if (enclosingClass != null) {
        InterfaceType enclosingType = enclosingClass.getType();
        element = lookUpMethod(null, enclosingType, methodName.getName());
        if (element == null) {
          //
          // If there's no method, then it's possible that 'm' is a getter that returns a function.
          //
View Full Code Here

      // Special getter cases.
      if (propertyName.inGetterContext()) {
        if (!isStaticProperty && staticOrPropagatedEnclosingElt instanceof ClassElement) {
          ClassElement classElement = (ClassElement) staticOrPropagatedEnclosingElt;
          InterfaceType targetType = classElement.getType();
          if (targetType != null && targetType.isDartCoreFunction()
              && propertyName.getName().equals(FunctionElement.CALL_METHOD_NAME)) {
            // TODO(brianwilkerson) Can we ever resolve the function being invoked?
            //resolveArgumentsToParameters(node.getArgumentList(), invokedFunction);
            return;
          } else if (classElement.isEnum() && propertyName.getName().equals("_name")) {
View Full Code Here

          new SyntheticIdentifier(node.getName() + "="),
          definingLibrary);
    }
    ClassElement enclosingClass = resolver.getEnclosingClass();
    if (element == null && enclosingClass != null) {
      InterfaceType enclosingType = enclosingClass.getType();
      if (element == null
          && (node.inSetterContext() || node.getParent() instanceof CommentReference)) {
        element = lookUpSetter(null, enclosingType, node.getName());
      }
      if (element == null && node.inGetterContext()) {
View Full Code Here

      return baseFunctionType;
    }
    FunctionType functionTypeToReturn = baseFunctionType;
    // loop backward through the list substituting as we go:
    while (!inheritancePath.isEmpty()) {
      InterfaceType lastType = inheritancePath.removeLast();
      Type[] parameterTypes = lastType.getElement().getType().getTypeArguments();
      Type[] argumentTypes = lastType.getTypeArguments();
      functionTypeToReturn = functionTypeToReturn.substitute(argumentTypes, parameterTypes);
    }
    return functionTypeToReturn;
  }
View Full Code Here

      return resultMap;
    } else {
      resultMap = new MemberMap();
    }
    ClassElement superclassElt = null;
    InterfaceType supertype = classElt.getSupertype();
    if (supertype != null) {
      superclassElt = supertype.getElement();
    } else {
      // classElt is Object
      classLookup.put(classElt, resultMap);
      return resultMap;
    }
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.