Examples of TypeName


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

    ConstructorElement redirectedElement = redirectedConstructor.getStaticElement();
    if (redirectedElement == null) {
      //
      // If the element is null, we check for the REDIRECT_TO_MISSING_CONSTRUCTOR case
      //
      TypeName constructorTypeName = redirectedConstructor.getType();
      Type redirectedType = constructorTypeName.getType();
      if (redirectedType != null && redirectedType.getElement() != null
          && !redirectedType.isDynamic()) {
        //
        // Prepare the constructor name
        //
        String constructorStrName = constructorTypeName.getName().getName();
        if (redirectedConstructor.getName() != null) {
          constructorStrName += '.' + redirectedConstructor.getName().getName();
        }
        ErrorCode errorCode = node.getConstKeyword() != null
            ? CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR
View Full Code Here

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

    SimpleIdentifier name = node.getName();
    if (!name.getName().equals("[]=")) {
      return false;
    }
    // check return type
    TypeName typeName = node.getReturnType();
    if (typeName != null) {
      Type type = typeName.getType();
      if (type != null && !type.isVoid()) {
        errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName);
      }
    }
    // no warning
View Full Code Here

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

    NodeList<TypeName> typeNameArgList = node.getTypeArguments().getArguments();
    Type[] typeArguments = ((InterfaceType) type).getTypeArguments();
    int loopThroughIndex = Math.min(typeNameArgList.size(), boundingElts.length);
    boolean foundError = false;
    for (int i = 0; i < loopThroughIndex; i++) {
      TypeName argTypeName = typeNameArgList.get(i);
      Type argType = argTypeName.getType();
      Type boundType = boundingElts[i].getBound();
      if (argType != null && boundType != null) {
        if (typeArguments.length != 0 && typeArguments.length == typeParameters.length) {
          boundType = boundType.substitute(typeArguments, typeParameters);
        }
View Full Code Here

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

   * @param node the method declaration to evaluate
   * @return {@code true} if and only if an error code is generated on the passed node
   * @see StaticWarningCode#VOID_RETURN_FOR_GETTER
   */
  private boolean checkForVoidReturnType(MethodDeclaration node) {
    TypeName returnType = node.getReturnType();
    if (returnType == null || !returnType.getName().getName().equals("void")) {
      return false;
    }
    errorReporter.reportErrorForNode(StaticWarningCode.VOID_RETURN_FOR_GETTER, returnType);
    return true;
  }
View Full Code Here

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

    super.visitCatchClause(node);
    SimpleIdentifier exception = node.getExceptionParameter();
    if (exception != null) {
      // If an 'on' clause is provided the type of the exception parameter is the type in the 'on'
      // clause. Otherwise, the type of the exception parameter is 'Object'.
      TypeName exceptionTypeName = node.getExceptionType();
      Type exceptionType;
      if (exceptionTypeName == null) {
        exceptionType = getTypeProvider().getDynamicType();
      } else {
        exceptionType = getType(exceptionTypeName);
View Full Code Here

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

  @Override
  public Void visitDeclaredIdentifier(DeclaredIdentifier node) {
    super.visitDeclaredIdentifier(node);
    Type declaredType;
    TypeName typeName = node.getType();
    if (typeName == null) {
      declaredType = dynamicType;
    } else {
      declaredType = getType(typeName);
    }
View Full Code Here

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

    if (element instanceof ParameterElementImpl) {
      ParameterElementImpl parameter = (ParameterElementImpl) element;
      FormalParameterList parameterList = node.getParameters();
      if (parameterList == null) {
        Type type;
        TypeName typeName = node.getType();
        if (typeName == null) {
          type = dynamicType;
          if (parameter instanceof FieldFormalParameterElement) {
            FieldElement fieldElement = ((FieldFormalParameterElement) parameter).getField();
            if (fieldElement != null) {
View Full Code Here

Examples of com.google.java.contract.core.model.TypeName

  private ContractAnnotationModel createBlankContractModel(Element parent,
      AnnotationMirror annotation, boolean primary, ClassName owner) {
    ElementKind kind = utils.getAnnotationKindForName(annotation);

    boolean virtual;
    TypeName returnType;
    switch (parent.getKind()) {
      default:
        virtual =
            parent.getKind()
            != javax.lang.model.element.ElementKind.INTERFACE;
View Full Code Here

Examples of com.google.java.contract.core.model.TypeName

  @Requires({
    "method != null",
    "!method.isConstructor()"
  })
  private void appendNormalMethodCode(MethodModel method) {
    TypeName returnType = method.getReturnType();
    if (!returnType.getDeclaredName().equals("void")) {
      append("return ");
      append(getDefaultValue(returnType));
      append(";");
    }
  }
View Full Code Here

Examples of com.google.java.contract.core.model.TypeName

    String name = kind.getNameSpace() + getContractName(kind, contracted);
    if (nameSuffix != null) {
      name += nameSuffix;
    }
    ContractMethodModel contract =
        new ContractMethodModel(kind, name, new TypeName("void"), contracted);

    contract.addModifier(ElementModifier.PRIVATE);
    type.addMember(contract);

    return contract;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.