Package com.google.dart.engine.element

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


    // FunctionTypeAliasElementImpl assumes the enclosing element is a
    // CompilationUnitElement (because non-synthetic function types can only be declared
    // at top level), so to avoid breaking things, go find the compilation unit element.
    aliasElement.setEnclosingElement(element.getAncestor(CompilationUnitElement.class));
    FunctionTypeImpl type = new FunctionTypeImpl(aliasElement);
    ClassElement definingClass = element.getAncestor(ClassElement.class);
    if (definingClass != null) {
      aliasElement.shareTypeParameters(definingClass.getTypeParameters());
      type.setTypeArguments(definingClass.getType().getTypeArguments());
    } else {
      FunctionTypeAliasElement alias = element.getAncestor(FunctionTypeAliasElement.class);
      while (alias != null && alias.isSynthetic()) {
        alias = alias.getAncestor(FunctionTypeAliasElement.class);
      }
View Full Code Here


    return super.visitCatchClause(node);
  }

  @Override
  public Void visitClassDeclaration(ClassDeclaration node) {
    ClassElement outerClass = enclosingClass;
    try {
      SimpleIdentifier className = node.getName();
      enclosingClass = findIdentifier(enclosingUnit.getTypes(), className);
      processElement(enclosingClass);
      if (!hasConstructor(node)) {
View Full Code Here

    }
  }

  @Override
  public Void visitClassTypeAlias(ClassTypeAlias node) {
    ClassElement outerClass = enclosingClass;
    try {
      SimpleIdentifier className = node.getName();
      enclosingClass = findIdentifier(enclosingUnit.getTypes(), className);
      processElement(enclosingClass);
      return super.visitClassTypeAlias(node);
View Full Code Here

    }
  }

  @Override
  public Void visitEnumDeclaration(EnumDeclaration node) {
    ClassElement enclosingEnum = findIdentifier(enclosingUnit.getEnums(), node.getName());
    processElement(enclosingEnum);
    FieldElement[] constants = enclosingEnum.getFields();
    for (EnumConstantDeclaration constant : node.getConstants()) {
      FieldElement constantElement = findIdentifier(constants, constant.getName());
      processElement(constantElement);
    }
    return super.visitEnumDeclaration(node);
View Full Code Here

    return null;
  }

  @Override
  public Void visitClassDeclaration(ClassDeclaration node) {
    ClassElement classElement = node.getElement();
    Scope outerScope = nameScope;
    try {
      if (classElement == null) {
        AnalysisEngine.getInstance().getLogger().logInformation(
            "Missing element for class declaration " + node.getName().getName() + " in "
View Full Code Here

  @Override
  public Void visitClassTypeAlias(ClassTypeAlias node) {
    Scope outerScope = nameScope;
    try {
      ClassElement element = node.getElement();
      nameScope = new ClassScope(new TypeParameterScope(nameScope, element), element);
      super.visitClassTypeAlias(node);
    } finally {
      nameScope = outerScope;
    }
View Full Code Here

   * @param classElement the class element
   */
  private void computeSubtypesInClass(ClassElement classElement) {
    InterfaceType supertypeType = classElement.getSupertype();
    if (supertypeType != null) {
      ClassElement supertypeElement = supertypeType.getElement();
      if (supertypeElement != null) {
        putInSubtypeMap(supertypeElement, classElement);
      }
    }
    InterfaceType[] interfaceTypes = classElement.getInterfaces();
    for (InterfaceType interfaceType : interfaceTypes) {
      ClassElement interfaceElement = interfaceType.getElement();
      if (interfaceElement != null) {
        putInSubtypeMap(interfaceElement, classElement);
      }
    }
    InterfaceType[] mixinTypes = classElement.getMixins();
    for (InterfaceType mixinType : mixinTypes) {
      ClassElement mixinElement = mixinType.getElement();
      if (mixinElement != null) {
        putInSubtypeMap(mixinElement, classElement);
      }
    }
  }
View Full Code Here

      HashMap<String, String> nameMap) {
    if (elementName != null) {
      if (nameMap != null) {
        elementName = nameMap.get(elementName.toLowerCase());
      }
      ClassElement returnType = library.getType(elementName);
      if (returnType != null) {
        return returnType.getType();
      }
    }
    return null;
  }
View Full Code Here

      tag = StringUtilities.substringBeforeChar(tag, '[');
      tag = StringUtilities.substringBeforeChar(tag, '.');
      tag = StringUtilities.substringBeforeChar(tag, '#');

      tag = HTML_ELEMENT_TO_CLASS_MAP.get(tag.toLowerCase());
      ClassElement returnType = library.getType(tag);
      if (returnType != null) {
        return returnType.getType();
      }
    }
    return null;
  }
View Full Code Here

    return super.visitCatchClause(node);
  }

  @Override
  public Void visitClassDeclaration(ClassDeclaration node) {
    ClassElement outerClass = enclosingClass;
    try {
      SimpleIdentifier className = node.getName();
      enclosingClass = findIdentifier(enclosingUnit.getTypes(), className);
      return super.visitClassDeclaration(node);
    } finally {
View Full Code Here

TOP

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

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.