Examples of TypeMismatchException


Examples of com.alvazan.orm.api.exc.TypeMismatchException

    Class objectFieldType = DboColumnMeta.convertIfPrimitive(fieldType);
    if(value!=null){
      Class actualType = value.getClass();

      if(!objectFieldType.isAssignableFrom(actualType)){
        throw new TypeMismatchException("value [" + value
            + "] is not the correct type for the parameter='"+name+"' from inspecting the Entity.  Type should be=["
            + fieldType + "]");
      }    
    }
 
View Full Code Here

Examples of com.alvazan.orm.api.exc.TypeMismatchException

  public static Object fetchFieldValue(Object entity, Field field) {
    try {
      return field.get(entity);
    } catch (IllegalArgumentException e) {
      throw new TypeMismatchException("Entity='"+entity.getClass()+"' was passed to field of a different type.  field='"+field+"'", e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  } 
View Full Code Here

Examples of com.alvazan.orm.api.exc.TypeMismatchException

    for(MetaField<T> m : columnNameToField.values()) {
      try {
        m.translateToColumn(info);
      } catch(TypeMismatchException e) {
        throw new TypeMismatchException("The entity "+getMetaClass()+" has an incorrect annotation on field="+m.getField().getName()+".  The attribute 'entityType' on the annotation is incorrect for the types you are saving.", e);
      }
    }
    return row;
  }
View Full Code Here

Examples of com.alvazan.orm.api.exc.TypeMismatchException

    Class objectFieldType = ConverterUtil.convertIfPrimitive(fieldType);
    if(value!=null){
      Class actualType = value.getClass();

      if(!objectFieldType.isAssignableFrom(actualType)){
        throw new TypeMismatchException("value [" + value
            + "] is not the correct type for the parameter='"+name+"' from inspecting the Entity.  Type should be=["
            + fieldType + "]");
      }    
    }
 
View Full Code Here

Examples of com.google.visualization.datasource.base.TypeMismatchException

   * @throws TypeMismatchException Thrown if the values in the cells do not match the columns.
   */
  public void addRow(TableRow row) throws TypeMismatchException {
    List<TableCell> cells = row.getCells();
    if (cells.size() > columns.size()) {
      throw new TypeMismatchException("Row has too many cells. Should be at most of size: " +
          columns.size());
    }
    for (int i = 0; i < cells.size(); i++) {
      if (cells.get(i).getType() != columns.get(i).getType()) {
        throw new TypeMismatchException("Cell type does not match column type, at index: " + i +
            ". Should be of type: " + columns.get(i).getType().toString());
      }
    }
    for (int i = cells.size(); i < columns.size(); i++) {
      row.addCell(new TableCell(Value.getNullValueFromValueType(columns.get(i).getType())));
View Full Code Here

Examples of com.google.visualization.datasource.base.TypeMismatchException

   */
  public TableCell setCell(int rowIndex, int colIndex, TableCell cell)
      throws TypeMismatchException, IndexOutOfBoundsException {
    TableRow row = rows.get(rowIndex);
    if (!row.getCell(colIndex).getType().equals(cell.getType())) {
      throw new TypeMismatchException("New cell value type does not match expected value type." +
          " Expected type: " + row.getCell(colIndex).getType() +
          " but was: " + cell.getType().toString());
    }
    return row.setCell(colIndex, cell);
  }
View Full Code Here

Examples of eu.admire.dispel.parser.exception.TypeMismatchException

        {
            throw new UnknownTypeException(text);
        }
        if (!(var.getType() instanceof ProcessingElementTypeType))
        {
            throw new TypeMismatchException("ProcessingElementTypeType", var.getValue());
        }
        ProcessingElementTypeType type = (ProcessingElementTypeType)var.getType();
        SimpleProcessingElementDescriptor descriptor = null;
        if (type.getDescriptor() != null)
        {
View Full Code Here

Examples of eu.admire.dispel.parser.exception.TypeMismatchException

            for (Expression exp : expressions)
            {
                Object result = exp.evaluate(mExecutionState.getVariables());
                if (!(result instanceof Number))
                {  
                    throw new TypeMismatchException(PrimitiveType.INTEGER, result);
                }
                mArraySizes.add(((Number)result).intValue());
            }
            break;
        case WITH_ASSERTION:
View Full Code Here

Examples of eu.admire.dispel.parser.exception.TypeMismatchException

                        {
                            indices.add(((Long)result).intValue());
                        }
                        else
                        {
                            throw new TypeMismatchException("Integer", result);
                        }
                    }
                    variable.setValue(TypeUtils.newInstance(mType), indices);
                }
                else
View Full Code Here

Examples of eu.admire.dispel.parser.exception.TypeMismatchException

                    RequestNode node = (RequestNode)value;
                    mConnection = node.getOutput(connection.mName, connection.mIndex.intValue());
                }
                else
                {
                    throw new TypeMismatchException("ProcessingElement", value);
                }
            }
            break;
        }
        case INPUT:
        {
            ConnectionStrategy connection = (ConnectionStrategy)strategy;
            if (connection.mConnectionVar != null)
            {
                Connection c = (Connection) connection.mConnectionVar.getValue(connection.mArrayIndices);
                if (c == null ||
                        !(c.getSource() instanceof LiteralValuesNode &&
                                mConnection.getSource() instanceof LiteralValuesNode))
                {
                    connection.mConnectionVar.setValue(mConnection, connection.mArrayIndices);
                }
                else
                {
                    LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
                    LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
                    literal.add(current.getValues());
                }
            }
            else
            {
                Object value;
                Variable variable =
                    mExecutionState.getVariables().get(connection.mPE);
                if (variable == null)
                {
                    throw new UnresolvedVariableException(connection.mPE);
                }
                value = variable.getValue(connection.mArrayIndices);
                if (value instanceof RequestNode)
                {
                    RequestNode node = (RequestNode)value;
                    if (node.getAllInputs().containsKey(connection.mName))
                    {
                        Connection c = node.getAllInputs().get(connection.mName).get(connection.mIndex);
                        if (c != null && c.getSource() instanceof LiteralValuesNode
                                && mConnection.getSource() instanceof LiteralValuesNode)
                        {
                            LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
                            LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
                            literal.add(current.getValues());
                        }
                        else
                        {
                            node.connectInput(connection.mName, connection.mIndex.intValue(), mConnection);
                        }
                    }
                    else
                    {
                        node.connectInput(connection.mName, connection.mIndex.intValue(), mConnection);
                    }
                }
                else
                {
                    throw new TypeMismatchException("ProcessingElement", value);
                }
            }
            break;
        }
        case ARRAY:
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.