Package org.teiid.core.types

Examples of org.teiid.core.types.TransformationException


   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return Long.valueOf(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0022", CorePlugin.Util.getString("ERR.003.029.0022", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here


   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return new BigInteger(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0015", CorePlugin.Util.getString("ERR.003.029.0015", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

           }
             while (xmlReader.hasNext()) {
               xmlReader.next();
             }
        } catch (Exception e){
            throw new TransformationException(e, CorePlugin.Util.getString("invalid_string")); //$NON-NLS-1$
        } finally {
          try {
        reader.close();
      } catch (IOException e) {
      }
View Full Code Here

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return Double.valueOf((String)value);
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0019", CorePlugin.Util.getString("ERR.003.029.0019", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return new BigDecimal(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0014", CorePlugin.Util.getString("ERR.003.029.0014", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

    value = ((String) value).trim();
    Timestamp result = null;
    try {
      result = Timestamp.valueOf( (String) value );
    } catch(Exception e) {
      throw new TransformationException(e, "ERR.003.029.0024", CorePlugin.Util.getString("ERR.003.029.0024", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
    //validate everything except for fractional seconds
    if (!((String)value).startsWith(result.toString().substring(0, 19))) {
      throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
    }
    return result;
  }
View Full Code Here

            }
            reader.close();
            return contents.toString();        
           
        } catch (SQLException e) {
            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$           
        } catch(IOException e) {
            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$
        }
    }
View Full Code Here

            char[] result = new char[DataTypeManager.MAX_STRING_LENGTH];
            reader = source.getCharacterStream();
            int read = reader.read(result);
            return new String(result, 0, read);
        } catch (SQLException e) {
            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$           
        } catch (IOException e) {
            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$
        } finally {
          try {
            if (reader != null) {
              reader.close();
            }
View Full Code Here

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return Byte.valueOf(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0016", CorePlugin.Util.getString("ERR.003.029.0016", value));
    }
  }
View Full Code Here

      FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING);
     
      try {
        ObjectConverterUtil.write(fsisf.getOuputStream(), ((DataSource)value).getInputStream(), -1);
      } catch (IOException e) {
        throw new TransformationException(e, e.getMessage());
      }
      return new BlobType(new BlobImpl(fsisf));
    }
    if (value instanceof Source) {
      if (value instanceof InputStreamFactory) {
View Full Code Here

TOP

Related Classes of org.teiid.core.types.TransformationException

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.