Package com.google.dart.engine.element

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


    return null;
  }

  @Override
  public Void visitInstanceCreationExpression(InstanceCreationExpression node) {
    ConstructorElement invokedConstructor = node.getConstructorName().getStaticElement();
    node.setStaticElement(invokedConstructor);
    ArgumentList argumentList = node.getArgumentList();
    ParameterElement[] parameters = resolveArgumentsToFunction(
        node.isConst(),
        argumentList,
View Full Code Here


    if (enclosingClass == null) {
      // TODO(brianwilkerson) Report this error.
      return null;
    }
    SimpleIdentifier name = node.getConstructorName();
    ConstructorElement element;
    if (name == null) {
      element = enclosingClass.getUnnamedConstructor();
    } else {
      element = enclosingClass.getNamedConstructor(name.getName());
    }
View Full Code Here

      // TODO(brianwilkerson) Report this error.
      return null;
    }
    SimpleIdentifier name = node.getConstructorName();
    String superName = name != null ? name.getName() : null;
    ConstructorElement element = superType.lookUpConstructor(superName, definingLibrary);
    if (element == null) {
      if (name != null) {
        resolver.reportErrorForNode(
            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
            node,
            superType.getDisplayName(),
            name);
      } else {
        resolver.reportErrorForNode(
            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
            node,
            superType.getDisplayName());
      }
      return null;
    } else {
      if (element.isFactory()) {
        resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node, element);
      }
    }
    if (name != null) {
      name.setStaticElement(element);
View Full Code Here

        nameNode1 = (SimpleIdentifier) annName;
        nameNode2 = null;
      }
    }
    SimpleIdentifier nameNode3 = annotation.getConstructorName();
    ConstructorElement constructor = null;
    //
    // CONST or Class(args)
    //
    if (nameNode1 != null && nameNode2 == null && nameNode3 == null) {
      Element element1 = nameNode1.getStaticElement();
View Full Code Here

              parameterTypes);
          InterfaceType classType = classElement.getType();
          ArrayList<ConstructorElement> implicitConstructors = new ArrayList<ConstructorElement>(
              count);
          for (int i = 0; i < count; i++) {
            ConstructorElement explicitConstructor = constructors[i];
            if (!explicitConstructor.isFactory()) {
              implicitConstructors.add(createImplicitContructor(
                  classType,
                  explicitConstructor,
                  parameterTypes,
                  argumentTypes));
View Full Code Here

    try {
      SimpleIdentifier className = node.getName();
      enclosingClass = findIdentifier(enclosingUnit.getTypes(), className);
      processElement(enclosingClass);
      if (!hasConstructor(node)) {
        ConstructorElement constructor = enclosingClass.getUnnamedConstructor();
        if (constructor.isSynthetic()) {
          processElement(constructor);
        }
      }
      return super.visitClassDeclaration(node);
    } finally {
View Full Code Here

    return null;
  }

  @Override
  public Void visitConstructorDeclaration(ConstructorDeclaration node) {
    ConstructorElement constructorElement = node.getElement();
    Scope outerScope = nameScope;
    try {
      if (constructorElement == null) {
        StringBuilder builder = new StringBuilder();
        builder.append("Missing element for constructor ");
View Full Code Here

   */
  @Override
  public Void visitInstanceCreationExpression(InstanceCreationExpression node) {
    recordStaticType(node, node.getConstructorName().getType().getType());

    ConstructorElement element = node.getStaticElement();
    if (element != null && "Element".equals(element.getEnclosingElement().getName())) {
      LibraryElement library = element.getLibrary();
      if (isHtmlLibrary(library)) {
        String constructorName = element.getName();
        if ("tag".equals(constructorName)) {
          Type returnType = getFirstArgumentAsTypeWithMap(
              library,
              node.getArgumentList(),
              HTML_ELEMENT_TO_CLASS_MAP);
View Full Code Here

TOP

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

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.