Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.ClassDeclaration


      if (element instanceof AngularElement) {
        return element;
      }
    }
    // prepare enclosing ClassDeclaration
    ClassDeclaration classDeclaration = node.getAncestor(ClassDeclaration.class);
    if (classDeclaration == null) {
      return null;
    }
    // prepare ClassElement
    ClassElement classElement = classDeclaration.getElement();
    if (classElement == null) {
      return null;
    }
    // check toolkit objects
    for (ToolkitObjectElement toolkitObject : classElement.getToolkitObjects()) {
View Full Code Here


        }
      }
      holder.validate();
    } catch (Exception ex) {
      if (node.getName().getStaticElement() == null) {
        ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
        StringBuilder builder = new StringBuilder();
        builder.append("The element for the method ");
        builder.append(node.getName());
        builder.append(" in ");
        builder.append(classNode.getName());
        builder.append(" was not set while trying to build the element model.");
        AnalysisEngine.getInstance().getLogger().logError(
            builder.toString(),
            new AnalysisException(builder.toString(), ex));
      } else {
        String message = "Exception caught in ElementBuilder.visitMethodDeclaration()";
        AnalysisEngine.getInstance().getLogger().logError(
            message,
            new AnalysisException(message, ex));
      }
    } finally {
      if (node.getName().getStaticElement() == null) {
        ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
        StringBuilder builder = new StringBuilder();
        builder.append("The element for the method ");
        builder.append(node.getName());
        builder.append(" in ");
        builder.append(classNode.getName());
        builder.append(" was not set while trying to resolve types.");
        AnalysisEngine.getInstance().getLogger().logError(
            builder.toString(),
            new AnalysisException(builder.toString()));
      }
View Full Code Here

        && node.getParent() instanceof ClassDeclaration) {
      Element element = getNameScope().lookup(identifier, getDefiningLibrary());
      if (element != null && element.getLibrary().isDartCore()
          && element instanceof PropertyAccessorElement) {
        // This is the @proxy from dart.core
        ClassDeclaration classDeclaration = (ClassDeclaration) node.getParent();
        ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(element);
        node.setElementAnnotation(elementAnnotation);
        ((ClassElementImpl) classDeclaration.getElement()).setMetadata(new ElementAnnotationImpl[] {elementAnnotation});
      }
    }
    return null;
  }
View Full Code Here

  @Override
  public Void visitConstructorDeclaration(ConstructorDeclaration node) {
    super.visitConstructorDeclaration(node);
    ExecutableElementImpl element = (ExecutableElementImpl) node.getElement();
    if (element == null) {
      ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
      StringBuilder builder = new StringBuilder();
      builder.append("The element for the constructor ");
      builder.append(node.getName() == null ? "<unnamed>" : node.getName().getName());
      builder.append(" in ");
      if (classNode == null) {
        builder.append("<unknown class>");
      } else {
        builder.append(classNode.getName().getName());
      }
      builder.append(" in ");
      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
View Full Code Here

  @Override
  public Void visitMethodDeclaration(MethodDeclaration node) {
    super.visitMethodDeclaration(node);
    ExecutableElementImpl element = (ExecutableElementImpl) node.getElement();
    if (element == null) {
      ClassDeclaration classNode = node.getAncestor(ClassDeclaration.class);
      StringBuilder builder = new StringBuilder();
      builder.append("The element for the method ");
      builder.append(node.getName().getName());
      builder.append(" in ");
      if (classNode == null) {
        builder.append("<unknown class>");
      } else {
        builder.append(classNode.getName().getName());
      }
      builder.append(" in ");
      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
View Full Code Here

TOP

Related Classes of com.google.dart.engine.ast.ClassDeclaration

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.