Package com.google.dart.engine.element

Examples of com.google.dart.engine.element.MethodElement


   * then {@code null} will be returned.
   *
   * @return the best element available for this operator
   */
  public MethodElement getBestElement() {
    MethodElement element = getPropagatedElement();
    if (element == null) {
      element = getStaticElement();
    }
    return element;
  }
View Full Code Here


   * then {@code null} will be returned.
   *
   * @return the best element available for this operator
   */
  public MethodElement getBestElement() {
    MethodElement element = getPropagatedElement();
    if (element == null) {
      element = getStaticElement();
    }
    return element;
  }
View Full Code Here

   * then {@code null} will be returned.
   *
   * @return the best element available for this operator
   */
  public MethodElement getBestElement() {
    MethodElement element = getPropagatedElement();
    if (element == null) {
      element = getStaticElement();
    }
    return element;
  }
View Full Code Here

   * then {@code null} will be returned.
   *
   * @return the best element available for this operator
   */
  public MethodElement getBestElement() {
    MethodElement element = getPropagatedElement();
    if (element == null) {
      element = getStaticElement();
    }
    return element;
  }
View Full Code Here

    return getter;
  }

  private MethodElement internalLookUpConcreteMethod(String methodName, LibraryElement library,
      boolean includeThisClass) {
    MethodElement method = internalLookUpMethod(methodName, library, includeThisClass);
    while (method != null && method.isAbstract()) {
      ClassElement definingClass = method.getEnclosingElement();
      if (definingClass == null) {
        return null;
      }
      method = definingClass.lookUpInheritedMethod(methodName, library);
    }
View Full Code Here

  private MethodElement internalLookUpMethod(String methodName, LibraryElement library,
      boolean includeThisClass) {
    HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
    ClassElement currentElement = this;
    if (includeThisClass) {
      MethodElement element = currentElement.getMethod(methodName);
      if (element != null && element.isAccessibleIn(library)) {
        return element;
      }
    }
    while (currentElement != null && visitedClasses.add(currentElement)) {
      for (InterfaceType mixin : currentElement.getMixins()) {
        ClassElement mixinElement = mixin.getElement();
        if (mixinElement != null) {
          MethodElement element = mixinElement.getMethod(methodName);
          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;
      }
    }
    return null;
  }
View Full Code Here

    // Return if the operator is not '/'
    if (!node.getOperator().getType().equals(TokenType.SLASH)) {
      return false;
    }
    // Return if the '/' operator is not defined in core, or if we don't know its static or propagated type
    MethodElement methodElement = node.getBestElement();
    if (methodElement == null) {
      return false;
    }
    LibraryElement libraryElement = methodElement.getLibrary();
    if (libraryElement != null && !libraryElement.isDartCore()) {
      return false;
    }
    // Report error if the (x/y) has toInt() invoked on it
    if (node.getParent() instanceof ParenthesizedExpression) {
View Full Code Here

  private boolean checkForOverrideEqualsButNotHashCode(ClassDeclaration node) {
    ClassElement classElement = node.getElement();
    if (classElement == null) {
      return false;
    }
    MethodElement equalsOperatorMethodElement = classElement.getMethod(TokenType.EQ_EQ.getLexeme());
    if (equalsOperatorMethodElement != null) {
      PropertyAccessorElement hashCodeElement = classElement.getGetter(HASHCODE_GETTER_NAME);
      if (hashCodeElement == null) {
        errorReporter.reportErrorForNode(
            HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
View Full Code Here

   * then {@code null} will be returned.
   *
   * @return the best element available for this operator
   */
  public MethodElement getBestElement() {
    MethodElement element = getPropagatedElement();
    if (element == null) {
      element = getStaticElement();
    }
    return element;
  }
View Full Code Here

    return getBaseElement().isAbstract();
  }

  @Override
  public String toString() {
    MethodElement baseElement = getBaseElement();
    ParameterElement[] parameters = getParameters();
    FunctionType type = getType();
    StringBuilder builder = new StringBuilder();
    builder.append(baseElement.getEnclosingElement().getDisplayName());
    builder.append(".");
    builder.append(baseElement.getDisplayName());
    builder.append("(");
    int parameterCount = parameters.length;
    for (int i = 0; i < parameterCount; i++) {
      if (i > 0) {
        builder.append(", ");
View Full Code Here

TOP

Related Classes of com.google.dart.engine.element.MethodElement

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.