Examples of TypeConversionException


Examples of jodd.typeconverter.TypeConversionException

      if (type == byte[].class) {
        byte[] valueArray = (byte[]) value;
        try {
          return new String(valueArray, 0, valueArray.length, JoddCore.encoding);
        } catch (UnsupportedEncodingException ueex) {
          throw new TypeConversionException(ueex);
        }
      }
      if (type == char[].class) {
        char[] charArray = (char[]) value;
        return new String(charArray);
      }
      return CsvUtil.toCsvString((Object[])value);
    }
    if (value instanceof Clob) {
      Clob clob = (Clob) value;
      try {
        long length = clob.length();
        if (length > Integer.MAX_VALUE) {
          throw new TypeConversionException("Clob is too big.");
        }
        return clob.getSubString(1, (int) length);
      } catch (SQLException sex) {
        throw new TypeConversionException(value, sex);
      }
    }
    return value.toString();
  }
View Full Code Here

Examples of jodd.typeconverter.TypeConversionException

      if (StringUtil.startsWithChar(stringValue, '+')) {
        stringValue = stringValue.substring(1);
      }
      return Byte.valueOf(stringValue);
    } catch (NumberFormatException nfex) {
      throw new TypeConversionException(value, nfex);
    }
  }
View Full Code Here

Examples of nexj.core.meta.TypeConversionException

         return new Binary(bos.toByteArray());
      }
      catch (IOException e)
      {
         throw new TypeConversionException(Primitive.ANY, e);
      }
   }
View Full Code Here

Examples of nexj.core.meta.TypeConversionException

      {
         oid.read(is, -1);
      }
      catch (IOException e)
      {
         throw new TypeConversionException(Primitive.ANY, e);
      }
      finally
      {
         IOUtil.close(is);
      }
View Full Code Here

Examples of nexj.core.meta.TypeConversionException

            {
               list = new InstanceArrayList(Arrays.asList((Object[])value));
            }
            else
            {
               throw new TypeConversionException(type);
            }

            for (int i = 0, n = list.getCount(); i < n; ++i)
            {
               type.convert(list.get(i));
View Full Code Here

Examples of nexj.core.meta.TypeConversionException

   {
      Converter converter = s_converterArray[fromType.getOrdinal() * Primitive.MAX_COUNT + toType.getOrdinal()];

      if (converter == null)
      {
         throw new TypeConversionException(toType);
      }

      return converter;
   }
View Full Code Here

Examples of org.apache.camel.TypeConversionException

        if (exchange != null) {
            body = MessageHelper.extractValueForLogging(value, exchange.getIn());
        } else {
            body = value;
        }
        return new TypeConversionException(body, type, cause);
    }
View Full Code Here

Examples of org.apache.camel.TypeConversionException

            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE) {
            if (statistics.isStatisticsEnabled()) {
                missCounter.incrementAndGet();
View Full Code Here

Examples of org.apache.camel.TypeConversionException

            }
            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE || value == null) {
            if (statistics.isStatisticsEnabled()) {
                missCounter.incrementAndGet();
View Full Code Here

Examples of org.apache.camel.TypeConversionException

                if (isJaxbType(value.getClass()) && isNotStreamCacheType(type)) {
                    return marshall(type, exchange, value);
                }
            }
        } catch (Exception e) {
            throw new TypeConversionException(value, type, e);
        }

        // should return null if didn't even try to convert at all or for whatever reason the conversion is failed
        return null;
    }
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.