Package org.jboss.errai.codegen.exception

Examples of org.jboss.errai.codegen.exception.InvalidTypeException


        if (classAliases.contains(from.getFullyQualifiedName()) && classAliases.contains(to.getFullyQualifiedName())) {
          // handle convertibility between MetaClass API and java Class reference.
          return;
        }

        throw new InvalidTypeException(to.getFullyQualifiedName() + " is not assignable from "
            + from.getFullyQualifiedName());
      }
    }
  }
View Full Code Here


      else {
        return generate(context, input);
      }
    }
    catch (NumberFormatException nfe) {
      throw new InvalidTypeException(nfe);
    }
  }
View Full Code Here

    if (!generated) {
      appendCallElement(new DeferredCallElement(new DeferredCallback() {
        @Override
        public void doDeferred(final CallWriter writer, final Context context, final Statement statement) {
          if (extendsBlock == null && (type.isAbstract() || type.isInterface() || type.isPrimitive()))
            throw new InvalidTypeException("Cannot instantiate type:" + type, blame);

          writer.reset();

          final CallParameters callParameters = (parameters != null) ?
              fromStatements(GenUtil.generateCallParameters(context, parameters)) : CallParameters.none();
View Full Code Here

          // handle convertability between MetaClass API and java Class reference.
          return;
        }


        throw new InvalidTypeException(to.getFullyQualifiedName() + " is not assignable from "
                + from.getFullyQualifiedName());
      }
    }
  }
View Full Code Here

      else {
        return generate(context, input);
      }
    }
    catch (NumberFormatException nfe) {
      throw new InvalidTypeException(nfe);
    }
  }
View Full Code Here

        if (classAliases.contains(from.getFullyQualifiedName()) && classAliases.contains(to.getFullyQualifiedName())) {
          // handle convertibility between MetaClass API and java Class reference.
          return;
        }

        throw new InvalidTypeException(to.getFullyQualifiedName() + " is not assignable from "
            + from.getFullyQualifiedName());
      }
    }
  }
View Full Code Here

      else {
        return generate(context, input);
      }
    }
    catch (NumberFormatException nfe) {
      throw new InvalidTypeException(nfe);
    }
  }
View Full Code Here

  private MetaClass inferType(final Context context, final Object initialization) {
    final Statement initStatement = GenUtil.generate(context, initialization);
    final MetaClass inferredType = (initStatement != null) ? initStatement.getType() : null;
    if (inferredType == null) {
      throw new InvalidTypeException("No type specified and no initialization provided to infer the type.");
    }

    return inferredType;
  }
View Full Code Here

      if (context.isPermissiveMode()) {
        return "(" + LoadClassReference.getClassReference(toType, context) + ") " + stmt;
      }
      else {
        throw new InvalidTypeException(statement.getType() + " cannot be cast to " + toType);
      }
    }
    else if (toType.isAssignableFrom(statement.getType()) && !statement.getType().equals(MetaClassFactory.get(NullType.class))) {
      return stmt;
    }
View Full Code Here

 
      final VariableReference ref = context.getVariable(variableName);
 
      if (idx.length > 0) {
        if (!ref.getType().isArray()) {
          throw new InvalidTypeException("attempt to use indexed accessor on non-array type: " + ref);
        }
      }
 
      final Statement stmt = new VariableReference() {
        @Override
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.exception.InvalidTypeException

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.