Package org.jboss.errai.codegen.framework.exception

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


      throw new TypeNotIterableException(statement.generate(Context.create()));
  }

  public static void assertAssignableTypes(MetaClass from, MetaClass to) {
    if (!to.asBoxed().isAssignableFrom(from.asBoxed())) {
      throw new InvalidTypeException(to.getFullyQualifiedName() + " is not assignable from "
              + from.getFullyQualifiedName());
    }
  }
View Full Code Here


    }
    catch (OutOfScopeException e) {
      throw e;
    }
    catch (Throwable t) {
      throw new InvalidTypeException(t);
    }
  }
View Full Code Here

      throw e;
    }

    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

      throw new TypeNotIterableException(statement.generate(Context.create()));
  }

  public static void assertAssignableTypes(MetaClass from, MetaClass to) {
    if (!to.asBoxed().isAssignableFrom(from.asBoxed())) {
      throw new InvalidTypeException(to.getFullyQualifiedName() + " is not assignable from "
              + from.getFullyQualifiedName());
    }
  }
View Full Code Here

    }
    catch (OutOfScopeException e) {
      throw e;
    }
    catch (Throwable t) {
      throw new InvalidTypeException(t);
    }
  }
View Full Code Here

 
  private MetaClass inferType(Context context, Object initialization) {
    Statement initStatement = GenUtil.generate(context, initialization);
    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

  @Override
  public String generate(Context context) {
    String stmt = statement.generate(context);

    if (!toType.isAssignableFrom(statement.getType()) && !toType.isAssignableTo(statement.getType())) {
      throw new InvalidTypeException(statement.getType() + " cannot be cast to " + toType);
    }
    else if (toType.isAssignableFrom(statement.getType())) {
      return stmt;
    }
    else {
View Full Code Here

    MetaClass referenceType = reference.getType();
    Statement[] indexes = reference.getIndexes();
    if (indexes!=null) {
      for (Statement index : indexes) {
        if (!referenceType.isArray())
          throw new InvalidTypeException("Variable is not a " + indexes.length + "-dimensional array!");
        referenceType = referenceType.getComponentType();
      }
    }
    operator.assertCanBeApplied(referenceType);
    operator.assertCanBeApplied(statement.getType());
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

    }
    catch (OutOfScopeException e) {
      throw e;
    }
    catch (Throwable t) {
      throw new InvalidTypeException(t);
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.framework.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.