Package com.google.dart.engine.element

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


        if (returnType == node) {
          SimpleIdentifier name = decl.getName();
          if (name != null) {
            return name.getBestElement();
          }
          Element element = node.getBestElement();
          if (element instanceof ClassElement) {
            return ((ClassElement) element).getUnnamedConstructor();
          }
        }
      }
      if (parent instanceof LibraryIdentifier) {
        AstNode grandParent = ((LibraryIdentifier) parent).getParent();
        if (grandParent instanceof PartOfDirective) {
          Element element = ((PartOfDirective) grandParent).getElement();
          if (element instanceof LibraryElement) {
            return ((LibraryElement) element).getDefiningCompilationUnit();
          }
        }
      }
View Full Code Here


    if (propagatedElement != null) {
      executableElement = propagatedElement;
    } else {
      if (leftHandSide instanceof Identifier) {
        Identifier identifier = (Identifier) leftHandSide;
        Element leftElement = identifier.getPropagatedElement();
        if (leftElement instanceof ExecutableElement) {
          executableElement = (ExecutableElement) leftElement;
        }
      }
      if (leftHandSide instanceof PropertyAccess) {
        SimpleIdentifier identifier = ((PropertyAccess) leftHandSide).getPropertyName();
        Element leftElement = identifier.getPropagatedElement();
        if (leftElement instanceof ExecutableElement) {
          executableElement = (ExecutableElement) leftElement;
        }
      }
    }
View Full Code Here

    ExecutableElement executableElement = null;
    if (staticElement != null) {
      executableElement = staticElement;
    } else {
      if (leftHandSide instanceof Identifier) {
        Element leftElement = ((Identifier) leftHandSide).getStaticElement();
        if (leftElement instanceof ExecutableElement) {
          executableElement = (ExecutableElement) leftElement;
        }
      }
      if (leftHandSide instanceof PropertyAccess) {
        Element leftElement = ((PropertyAccess) leftHandSide).getPropertyName().getStaticElement();
        if (leftElement instanceof ExecutableElement) {
          executableElement = (ExecutableElement) leftElement;
        }
      }
    }
View Full Code Here

    if (node == null) {
      return null;
    }
    // try to get Element from node
    {
      Element nodeElement = locate(node);
      if (nodeElement != null) {
        return nodeElement;
      }
    }
    // try to get Angular specific Element
    {
      Element element = AngularCompilationUnitBuilder.getElement(node, offset);
      if (element != null) {
        return element;
      }
    }
    // try to get Polymer specific Element
    {
      Element element = PolymerCompilationUnitBuilder.getElement(node, offset);
      if (element != null) {
        return element;
      }
    }
    // no Element
View Full Code Here

   * is a deferred prefix.
   *
   * @return {@code true} if this type is a deferred type
   */
  public boolean isDeferred() {
    Element element = prefix.getStaticElement();
    if (!(element instanceof PrefixElement)) {
      return false;
    }
    PrefixElement prefixElement = (PrefixElement) element;
    ImportElement[] imports = prefixElement.getEnclosingElement().getImportsWithPrefix(
View Full Code Here

    return properties;
  }

  @Override
  public boolean isClass(String name) {
    Element enclosing = getEnclosingElement();
    return enclosing instanceof ClassElement && enclosing.getName().equals(name);
  }
View Full Code Here

   * reference has been set to {@code null}.
   *
   * @return the element being represented by this handle
   */
  protected Element getActualElement() {
    Element element = elementReference.get();
    if (element == null) {
      element = context.getElement(location);
      elementReference = new WeakReference<Element>(element);
    }
    return element;
View Full Code Here

  private PropertyAccessorElement internalLookUpConcreteGetter(String getterName,
      LibraryElement library, boolean includeThisClass) {
    PropertyAccessorElement getter = internalLookUpGetter(getterName, library, includeThisClass);
    while (getter != null && getter.isAbstract()) {
      Element definingClass = getter.getEnclosingElement();
      if (!(definingClass instanceof ClassElementImpl)) {
        return null;
      }
      getter = ((ClassElementImpl) definingClass).internalLookUpGetter(getterName, library, false);
    }
View Full Code Here

  private PropertyAccessorElement internalLookUpConcreteSetter(String setterName,
      LibraryElement library, boolean includeThisClass) {
    PropertyAccessorElement setter = internalLookUpSetter(setterName, library, includeThisClass);
    while (setter != null && setter.isAbstract()) {
      Element definingClass = setter.getEnclosingElement();
      if (!(definingClass instanceof ClassElementImpl)) {
        return null;
      }
      setter = ((ClassElementImpl) definingClass).internalLookUpSetter(setterName, library, false);
    }
View Full Code Here

      return null;
    }
    SimpleStringLiteral literal = (SimpleStringLiteral) node;
    // maybe has AngularElement
    {
      Element element = literal.getToolkitElement();
      if (element instanceof AngularElement) {
        return element;
      }
    }
    // prepare enclosing ClassDeclaration
View Full Code Here

TOP

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

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.