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

  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 (classAliases.contains(from.getFullyQualifiedName()) && classAliases.contains(to.getFullyQualifiedName())) {
          // 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

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

    if (!toType.isPrimitive() && !toType.isAssignableFrom(statement.getType()) && !toType.isAssignableTo(statement.getType())) {
      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;
    }
    else {
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.