Package com.google.dart.engine.element

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


  public HintGenerator(CompilationUnit[] compilationUnits, AnalysisContext context,
      AnalysisErrorListener errorListener) {
    this.compilationUnits = compilationUnits;
    this.context = context;
    this.errorListener = errorListener;
    LibraryElement library = compilationUnits[0].getElement().getLibrary();
    importsVerifier = new ImportsVerifier(library);
    enableDart2JSHints = context.getAnalysisOptions().getDart2jsHint();
    manager = new InheritanceManager(compilationUnits[0].getElement().getLibrary());
  }
View Full Code Here


   *
   * @param member the member that overrides the returned member
   * @return the member that overrides the given member
   */
  private ExecutableElement getOverriddenMember(ExecutableElement member) {
    LibraryElement library = member.getLibrary();
    if (library == null) {
      return null;
    }
    ClassElement classElement = member.getAncestor(ClassElement.class);
    if (classElement == null) {
View Full Code Here

    TypeName typeName = node.getType();
    Type type = typeName.getType();
    if (type != null && type.getElement() != null) {
      Element element = type.getElement();
      String typeNameStr = element.getName();
      LibraryElement libraryElement = element.getLibrary();
//      if (typeNameStr.equals(INT_TYPE_NAME) && libraryElement != null
//          && libraryElement.isDartCore()) {
//        if (node.getNotOperator() == null) {
//          errorReporter.reportError(HintCode.IS_INT, node);
//        } else {
//          errorReporter.reportError(HintCode.IS_NOT_INT, node);
//        }
//        return true;
//      } else
      if (typeNameStr.equals(DOUBLE_TYPE_NAME) && libraryElement != null
          && libraryElement.isDartCore()) {
        if (node.getNotOperator() == null) {
          errorReporter.reportErrorForNode(HintCode.IS_DOUBLE, node);
        } else {
          errorReporter.reportErrorForNode(HintCode.IS_NOT_DOUBLE, node);
        }
View Full Code Here

  }

  @Override
  public boolean isDeprecated() {
    if (element != null) {
      LibraryElement library = element.getLibrary();
      if (library != null && library.isDartCore()) {
        if (element instanceof ConstructorElement) {
          ConstructorElement constructorElement = (ConstructorElement) element;
          if (constructorElement.getEnclosingElement().getName().equals(DEPRECATED_CLASS_NAME)) {
            return true;
          }
View Full Code Here

  }

  @Override
  public boolean isOverride() {
    if (element != null) {
      LibraryElement library = element.getLibrary();
      if (library != null && library.isDartCore()) {
        if (element instanceof PropertyAccessorElement
            && element.getName().equals(OVERRIDE_VARIABLE_NAME)) {
          return true;
        }
      }
View Full Code Here

  }

  @Override
  public boolean isProxy() {
    if (element != null) {
      LibraryElement library = element.getLibrary();
      if (library != null && library.isDartCore()) {
        if (element instanceof PropertyAccessorElement
            && element.getName().equals(PROXY_VARIABLE_NAME)) {
          return true;
        }
      }
View Full Code Here

   *
   * @param library the library whose import namespace is to be created
   * @return the import namespace that was created
   */
  public Namespace createImportNamespaceForDirective(ImportElement element) {
    LibraryElement importedLibrary = element.getImportedLibrary();
    if (importedLibrary == null) {
      //
      // The imported library will be null if the URI does not reference a valid library.
      //
      return Namespace.EMPTY;
View Full Code Here

      HashSet<LibraryElement> visitedElements) {
    visitedElements.add(library);
    try {
      HashMap<String, Element> definedNames = new HashMap<String, Element>();
      for (ExportElement element : library.getExports()) {
        LibraryElement exportedLibrary = element.getExportedLibrary();
        if (exportedLibrary != null && !visitedElements.contains(exportedLibrary)) {
          //
          // The exported library will be null if the URI does not reference a valid library.
          //
          HashMap<String, Element> exportedNames = createExportMapping(
View Full Code Here

  /**
   * @return the {@link Source} of the enclosing {@link LibraryElement}, may be {@code null}.
   */
  private static Source getLibrarySourceOrNull(Element element) {
    LibraryElement library = element.getLibrary();
    if (library == null) {
      return null;
    }
    if (library.isAngularHtml()) {
      return null;
    }
    return library.getSource();
  }
View Full Code Here

    }
    // validate unit
    if (unitElement == null) {
      return false;
    }
    LibraryElement libraryElement = unitElement.getLibrary();
    if (libraryElement == null) {
      return false;
    }
    CompilationUnitElement definingUnitElement = libraryElement.getDefiningCompilationUnit();
    if (definingUnitElement == null) {
      return false;
    }
    // prepare sources
    Source library = definingUnitElement.getSource();
    Source unit = unitElement.getSource();
    // special handling for the defining library unit
    if (unit.equals(library)) {
      // prepare new parts
      Set<Source> newParts = Sets.newHashSet();
      for (CompilationUnitElement part : libraryElement.getParts()) {
        newParts.add(part.getSource());
      }
      // prepare old parts
      Map<Source, Set<Source>> libraryToUnits = contextToLibraryToUnits.get(context);
      if (libraryToUnits == null) {
View Full Code Here

TOP

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

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.