Package com.google.dart.engine.element

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


   */
  private void recordSuperType(TypeName superNode, Relationship relationship) {
    if (superNode != null) {
      Identifier superName = superNode.getName();
      if (superName != null) {
        Element superElement = superName.getStaticElement();
        recordRelationship(superElement, relationship, createLocationFromNode(superNode));
      }
    }
  }
View Full Code Here


  }

  @Override
  protected Element internalLookup(Identifier identifier, String name,
      LibraryElement referencingLibrary) {
    Element foundElement = localLookup(name, referencingLibrary);
    if (foundElement != null) {
      return foundElement;
    }
    for (int i = 0; i < importedNamespaces.length; i++) {
      Namespace nameSpace = importedNamespaces[i];
      Element element = nameSpace.get(name);
      if (element != null) {
        if (foundElement == null) {
          foundElement = element;
        } else if (foundElement != element) {
          foundElement = MultiplyDefinedElementImpl.fromElements(
View Full Code Here

  private Element removeSdkElements(Identifier identifier, String name,
      MultiplyDefinedElementImpl foundElement) {
    Element[] conflictingMembers = foundElement.getConflictingElements();
    int length = conflictingMembers.length;
    int to = 0;
    Element sdkElement = null;
    for (Element member : conflictingMembers) {
      if (member.getLibrary().isInSdk()) {
        sdkElement = member;
      } else {
        conflictingMembers[to++] = member;
View Full Code Here

   * @see #computeSuperinterfaceSet(Type)
   * @see #getLeastUpperBound(Type)
   */
  private static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type,
      HashSet<InterfaceType> set) {
    Element element = type.getElement();
    if (element != null) {
      InterfaceType[] superinterfaces = type.getInterfaces();
      for (InterfaceType superinterface : superinterfaces) {
        if (set.add(superinterface)) {
          computeSuperinterfaceSet(superinterface, set);
View Full Code Here

   * @param shownNames the names to be shown
   */
  private HashMap<String, Element> show(HashMap<String, Element> definedNames, String[] shownNames) {
    HashMap<String, Element> newNames = new HashMap<String, Element>(definedNames.size());
    for (String name : shownNames) {
      Element element = definedNames.get(name);
      if (element != null) {
        newNames.put(name, element);
      }
      String setterName = name + "=";
      element = definedNames.get(setterName);
View Full Code Here

   */
  private void computeValueFor(AstNode constNode) {
    beforeComputeValue(constNode);
    if (constNode instanceof VariableDeclaration) {
      VariableDeclaration declaration = (VariableDeclaration) constNode;
      Element element = declaration.getElement();
      EvaluationResultImpl result = declaration.getInitializer().accept(createConstantVisitor());
      ((VariableElementImpl) element).setEvaluationResult(result);
    } else if (constNode instanceof InstanceCreationExpression) {
      InstanceCreationExpression expression = (InstanceCreationExpression) constNode;
      ConstructorElement constructor = expression.getStaticElement();
View Full Code Here

    @Override
    public int hashCode() {
      if (cachedHashCode == 0) {
        int firstHashCode = 0;
        if (firstType != null) {
          Element firstElement = firstType.getElement();
          firstHashCode = firstElement == null ? 0 : firstElement.hashCode();
        }
        int secondHashCode = 0;
        if (secondType != null) {
          Element secondElement = secondType.getElement();
          secondHashCode = secondElement == null ? 0 : secondElement.hashCode();
        }
        cachedHashCode = firstHashCode + secondHashCode;
      }
      return cachedHashCode;
    }
View Full Code Here

  final int elementId;
  final int offset;
  final int length;

  public LocationData(ElementCodec elementCodec, Location location) {
    Element element = location.getElement();
    this.elementId = elementCodec.encode(element);
    this.offset = location.getOffset();
    this.length = location.getLength();
  }
View Full Code Here

  /**
   * Returns a {@link Location} that is represented by this {@link LocationData}.
   */
  public Location getLocation(AnalysisContext context, ElementCodec elementCodec) {
    Element element = elementCodec.decode(context, elementId);
    if (element == null) {
      return null;
    }
    return new Location(element, offset, length);
  }
View Full Code Here

    return null;
  }

  @Override
  public Void visitSimpleIdentifier(SimpleIdentifier node) {
    Element element = node.getStaticElement();
    if (element instanceof PropertyAccessorElement) {
      element = ((PropertyAccessorElement) element).getVariable();
    }
    if (element instanceof VariableElement) {
      VariableElement variable = (VariableElement) element;
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.