예제 #1
0
 /**
  * Convert a DTCellValue52 to it's String representation
  *
  * @param dcv
  * @return
  */
 public String asString(final DTCellValue52 dcv) {
   switch (dcv.getDataType()) {
     case BOOLEAN:
       return convertBooleanValueToString(dcv);
     case DATE:
       return convertDateValueToString(dcv);
     case NUMERIC:
       return convertNumericValueToString(dcv);
     case NUMERIC_BIGDECIMAL:
       return convertBigDecimalValueToString(dcv);
     case NUMERIC_BIGINTEGER:
       return convertBigIntegerValueToString(dcv);
     case NUMERIC_BYTE:
       return convertByteValueToString(dcv);
     case NUMERIC_DOUBLE:
       return convertDoubleValueToString(dcv);
     case NUMERIC_FLOAT:
       return convertFloatValueToString(dcv);
     case NUMERIC_INTEGER:
       return convertIntegerValueToString(dcv);
     case NUMERIC_LONG:
       return convertLongValueToString(dcv);
     case NUMERIC_SHORT:
       return convertShortValueToString(dcv);
   }
   return convertStringValueToString(dcv);
 }
예제 #2
0
  /**
   * The column-data type is looked up from the SuggestionCompletionEngine and represents the *true*
   * data-type that the column represents. The data-type associated with the Cell Value can be
   * incorrect for legacy models. For pre-5.2 they will always be String and for pre-5.4 numerical
   * fields are always Numeric
   *
   * @param dataType
   * @param dcv
   */
  public void assertDTCellValue(DataType.DataTypes dataType, DTCellValue52 dcv) {
    if (dcv == null) {
      return;
    }

    // If already converted exit
    if (dataType.equals(dcv.getDataType())) {
      return;
    }

    switch (dcv.getDataType()) {
      case NUMERIC:
        convertDTCellValueFromNumeric(dataType, dcv);
        break;
      default:
        convertDTCellValueFromString(dataType, dcv);
    }
  }