Package com.google.dart.engine.index

Examples of com.google.dart.engine.index.Relationship


  public Void visitMethodInvocation(MethodInvocation node) {
    SimpleIdentifier name = node.getMethodName();
    Element element = name.getBestElement();
    if (element instanceof MethodElement || element instanceof PropertyAccessorElement) {
      Location location = createLocationFromNode(name);
      Relationship relationship;
      if (node.getTarget() != null) {
        relationship = IndexConstants.IS_INVOKED_BY_QUALIFIED;
      } else {
        relationship = IndexConstants.IS_INVOKED_BY_UNQUALIFIED;
      }
      recordRelationship(element, relationship, location);
    }
    if (element instanceof FunctionElement || element instanceof VariableElement) {
      Location location = createLocationFromNode(name);
      recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
    }
    // name invocation
    {
      Element nameElement = new NameElementImpl(name.getName());
      Location location = createLocationFromNode(name);
      Relationship kind = element != null ? IndexConstants.NAME_IS_INVOKED_BY_RESOLVED
          : IndexConstants.NAME_IS_INVOKED_BY_UNRESOLVED;
      store.recordRelationship(nameElement, kind, location);
    }
    recordImportElementReferenceWithoutPrefix(name);
    return super.visitMethodInvocation(node);
View Full Code Here


    // record name read/write
    {
      boolean inGetterContext = node.inGetterContext();
      boolean inSetterContext = node.inSetterContext();
      if (inGetterContext && inSetterContext) {
        Relationship kind = element != null ? IndexConstants.NAME_IS_READ_WRITTEN_BY_RESOLVED
            : IndexConstants.NAME_IS_READ_WRITTEN_BY_UNRESOLVED;
        store.recordRelationship(nameElement, kind, location);
      } else if (inGetterContext) {
        Relationship kind = element != null ? IndexConstants.NAME_IS_READ_BY_RESOLVED
            : IndexConstants.NAME_IS_READ_BY_UNRESOLVED;
        store.recordRelationship(nameElement, kind, location);
      } else if (inSetterContext) {
        Relationship kind = element != null ? IndexConstants.NAME_IS_WRITTEN_BY_RESOLVED
            : IndexConstants.NAME_IS_WRITTEN_BY_UNRESOLVED;
        store.recordRelationship(nameElement, kind, location);
      }
    }
    // record specific relations
View Full Code Here

      }
      if (StringUtilities.endsWithChar(name, '=') && !name.equals("==")) {
        name = name.substring(0, name.length() - 1);
      }
      Element nameElement = new NameElementImpl(name);
      Relationship relationship = element != null
          ? IndexConstants.IS_REFERENCED_BY_QUALIFIED_RESOLVED
          : IndexConstants.IS_REFERENCED_BY_QUALIFIED_UNRESOLVED;
      recordRelationship(nameElement, relationship, location);
    }
    // record element reference
View Full Code Here

   * or method invocation.
   */
  private void recordQualifiedMemberReference(SimpleIdentifier node, Element element,
      Element nameElement, Location location) {
    if (node.isQualified()) {
      Relationship relationship = element != null
          ? IndexConstants.IS_REFERENCED_BY_QUALIFIED_RESOLVED
          : IndexConstants.IS_REFERENCED_BY_QUALIFIED_UNRESOLVED;
      recordRelationship(nameElement, relationship, location);
    }
  }
View Full Code Here

    }
    // read Element(s)
    int numElements = dis.readInt();
    for (int i = 0; i < numElements; i++) {
      Element element = readElement();
      Relationship relationship = readRelationship();
      // read Location(s)
      int numLocations = dis.readInt();
      for (int j = 0; j < numLocations; j++) {
        Location location = readLocation();
        impl.recordRelationship(element, relationship, location);
View Full Code Here

TOP

Related Classes of com.google.dart.engine.index.Relationship

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.