Package com.google.dart.engine.element

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


    return super.visitXmlAttributeNode(node);
  }

  @Override
  public Void visitXmlTagNode(XmlTagNode node) {
    Element element = node.getElement();
    if (element != null) {
      // tag
      {
        Token tagToken = node.getTagToken();
        Location location = createLocationForToken(tagToken);
View Full Code Here


    }
  }

  @Override
  public EvaluationResultImpl visitPropertyAccess(PropertyAccess node) {
    Element element = node.getPropertyName().getStaticElement();
    // TODO(brianwilkerson) Uncomment the lines below when the new constant support can be added.
//    if (isStringLength(element)) {
//      EvaluationResultImpl target = node.getRealTarget().accept(this);
//      return target.stringLength(typeProvider, node);
//    }
View Full Code Here

    }
    PropertyAccessorElement accessor = (PropertyAccessorElement) element;
    if (!accessor.isGetter() || !accessor.getName().equals("length")) {
      return false;
    }
    Element parent = accessor.getEnclosingElement();
    return parent.equals(typeProvider.getStringType().getElement());
  }
View Full Code Here

    }
    return null;
  }

  private boolean isPublishedAnnotation(ElementAnnotation annotation) {
    Element element = annotation.getElement();
    if (element != null && element.getName().equals("published")) {
      return true;
    }
    return false;
  }
View Full Code Here

    // get types from locations
    Set<Type> types = Sets.newHashSet();
    for (Location location : locations) {
      // check scope
      if (scope != null) {
        Element targetElement = location.getElement();
        if (!scope.encloses(targetElement)) {
          continue;
        }
      }
      // we need data
View Full Code Here

  private void resolvePropertyNode(AngularHtmlUnitResolver resolver, List<Expression> expressions,
      Type itemType, SimpleIdentifier propertyNode) {
    // if known type - resolve, otherwise keep it 'dynamic'
    if (itemType instanceof InterfaceType) {
      String propertyName = propertyNode.getName();
      Element propertyElement = ((InterfaceType) itemType).getGetter(propertyName);
      if (propertyElement != null) {
        propertyNode.setStaticElement(propertyElement);
      }
    } else {
      Type dynamicType = resolver.getTypeProvider().getDynamicType();
View Full Code Here

      int count = arguments.length;
      for (int i = 0; i < count; i++) {
        Object argument = arguments[i];
        if (argument instanceof Type) {
          Type type = (Type) argument;
          Element element = type.getElement();
          if (element == null) {
            arguments[i] = type.getDisplayName();
          } else {
            arguments[i] = element.getExtendedDisplayName(type.getDisplayName());
          }
        }
      }
    } else {
      int count = arguments.length;
View Full Code Here

    }

    @Override
    public void hasRelationships(Element element, Relationship relationship, Location[] locations) {
      for (Location location : locations) {
        Element targetElement = location.getElement();
        // check scope
        if (scope != null && !scope.encloses(targetElement)) {
          continue;
        }
        SourceRange range = new SourceRange(location.getOffset(), location.getLength());
View Full Code Here

  @Override
  public Void visitAnnotation(Annotation node) {
    super.visitAnnotation(node);
    // check annotation creation
    Element element = node.getElement();
    if (element instanceof ConstructorElement) {
      ConstructorElement constructorElement = (ConstructorElement) element;
      // should 'const' constructor
      if (!constructorElement.isConst()) {
        errorReporter.reportErrorForNode(
View Full Code Here

      return false;
    } else if (type.equals(typeProvider.getDoubleType())) {
      return true;
    }
    // prepare ClassElement
    Element element = type.getElement();
    if (!(element instanceof ClassElement)) {
      return false;
    }
    ClassElement classElement = (ClassElement) element;
    // lookup for ==
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.